|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
AutoEventWireUp ProblemI am using Page_Error event in my aspx page to generate an error. Below is my code in my Page_Error event: private void Page_Error(object sender,System.EventArgs e) { Response.Write("Error:\n"); Exception ex = Server.GetLastError(); Trace.Write("Message",ex.Message); Trace.Write("Source",ex.Source); Trace.Write("Stack Trace",ex.StackTrace); Response.Write("Sorry, an error was encountered."); Context.ClearError(); } However the error is not generated because AutoEventWireup property is set to "false". When I set the AutoEventWireupto "true" is can see the error. I want to know the reason behind this whats AutoEventWireup got to do with Page_Error event. . How are they both co-related. Any help would be greatly appreciated cheers, Sam Solomon In ASP.Net 1.1, those methods were named by convention, but the templates
for usercontrols/pages would put in the wireup for you by overriding OnInit and saying Page.Load += new ....(this.Page_Load); AutoEventWireUp is a means of doing that automatically by the page upon initialization. If that value is true, on init, a page checks for Page_<event>, and if it has been defined in the code, an event handler will wrap it.
Problems with Re-Usable ASP.NET User Control Libraries
FtpWebRequest UploadFile WebCLient Web Server Control and property tree in design time like Font has. Retrieve Datagrid Element Index by Name Retrieve GridView column header text on sort DropDownList Box Webcontrol custom designer cannot access container data in templated control Newbie Listbox |
|||||||||||||||||||||||