$('a').click(function (e) {
try{
your code here.........
}
catch(e){}
return false;
});
dot net tips, DotNet tips, .Net Tips,Dot Net tips and tricks,Dot Net Solutions, OOPS Concept in C#,SQL Server, LinQ, Ajax, Java script, JQuery, Server Error details, daily .net tips and tricks , DotNet Interview Questions.
try catch in javascript
We can use try catch function in java script.
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);
}
<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
<%@ 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" />
Subscribe to:
Posts (Atom)