asp.net - how to call custom method automatically in global.asax -
here code , want call custom method (application_my()
) automatically when application loaded/refresh every time application_onendrequest()
.
thanks in advance.
<%@ application language="c#" %> <script runat="server"> // code executed automatically when page reloaded everytime /*protected void application_onendrequest() { response.write("thsi page executed on=" + datetime.now.tostring()); }*/ // how call below method automatically when page reloaded everytime //such above protected void application_my() { response.write("hi welcome"); } protected void application_start(object sender, eventargs e) { } protected void session_start(object sender, eventargs e) { } protected void application_beginrequest(object sender, eventargs e) { } protected void application_authenticaterequest(object sender, eventargs e) { } protected void application_error(object sender, eventargs e) { } protected void session_end(object sender, eventargs e) { } protected void application_end(object sender, eventargs e) { }
protected void application_endrequest(object sender, eventargs e) { application_my(); }
however, note called managed aspnet pipeline, might called on css , image requests.
you add debug.writeline(request.url); code above see happens when enter site.
Comments
Post a Comment