You need to Modify this sample as this was not getting rendered and i didn't had much time to look so i removed the brackets but the methods are intact mostly...
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
script
void handleClick(object sender, EventArgs e)
{
int a = 0;
int res = 10 / a;
}
void HandleError(object sender, AsyncPostBackErrorEventArgs e)
{
//here we could log the error, and see which exception we're getting in order to set a specific error message
//in this case, I'm just returning the current date/hour back
ScriptManager1.AsyncPostBackErrorMessage = "Ooops...error occurred: " + e.Exception.Message +
DateTime.Now.ToString();
}
/script
form id="form1" runat="server"
asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="HandleError" /
asp:UpdatePanel runat="server" ID="panel"
contenttemplate
asp:Button runat="server" ID="bt" Text="gerar erro no servidor"
OnClick="handleClick" /
/ContentTemplate
/asp:UpdatePanel
/form
No comments:
Post a Comment