try catch in javascript

We can use try catch function in java script.

$('a').click(function (e) {
  try{
      your code here.........
  }
   catch(e){}
  return false;
});
MultiView:
<asp:MultiView ID="MultiView1" runat="server" ActiveViewIndex="0">
<asp:view id=view1" runat ="server">
</view>
<asp:view id=view2" runat ="server">
</view>

</Multiview>
Previous Button:
protected void btnPrev_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex--;
        }
Next Button:
        protected void btnNext_Click(object sender, EventArgs e)
        {
            MultiView1.ActiveViewIndex++;
        }

 protected override void OnPreRender(EventArgs e)
        {
            btnPrev.Visible = MultiView1.ActiveViewIndex > 0;
            btnNext.Visible = MultiView1.ActiveViewIndex < MultiView1.Views.Count - 1;
            base.OnPreRender(e);
        }





A potentially dangerous Request.Form value was detected from the client

This issue happening if we entered text in controls that look like HTML statement. We can omit this issue  to set validation request is False.

<%@ Page Language="C#" MasterPageFile="~/ControlPanel/Site1.Master" ValidateRequest="false" AutoEventWireup="true" CodeFile="Cookies.aspx.cs" Inherits="ControlPanel_Cookies" %>



We can set this settings in globally when we write like below in web.config
<system.web>
<pages validateRequest="false" /> 


TRIM in SQL




The TRIM function is helped to remove specified prefix or suffix from a string. The most commonly we are using to remove white spaces.
 



SELECT RTRIM(LTRIM(' dotnettips4all ')) AS TRIM

SELECT RTRIM('             dotnettips4all             ')  AS RTRIM

SELECT LTRIM('        dotnettips4all          ')AS LTRIM