|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Can't get Global.asax to execute Sub
seem to get the Sub (writefile) to execute. It displays all the response.write lines that are called directly, but not any of the response.write lines from inside the sub. ******************************************* <%@ Application Language="VB" %> <script runat="server"> protected sub Application_Start(ByVal Sender as Object, _ ByVal e as EventArgs) WriteFile("Application Starting") end sub protected sub Application_End(ByVal Sender as Object, _ ByVal e as EventArgs) WriteFile("Application Ending") end sub protected sub Session_Start(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Session_Start" + "<br/>") end subprotected sub Session_End(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Session_End" + "<br/>") end subprotected sub Application_Disposed(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_Disposed" + "<br/>") end subprotected sub Application_Error(ByVal Sender as Object, _ ByVal e as EventArgs) dim strError as string strError = Server.GetLastError().ToString() Context.ClearError() Response.Write("Application_Error" + "<br/>") end subResponse.Write("Error Msg: " & strError + "<br/>") protected sub Application_BeginRequest(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_BeginRequest" + "<br/>") end subprotected sub Application_EndRequest(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_EndRequest" + "<br/>") end subprotected sub Application_AcquireRequestState(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_AcquireRequestState" + "<br/>") end subprotected sub Application_AuthenticateRequest(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_AuthenticateRequest" + "<br/>") end subprotected sub Application_AuthorizeRequest(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_AuthorizeRequest" + "<br/>") end subprotected sub Application_PostRequestHandlerExecute(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_PostRequestHandlerExecute" + "<br/>") end subprotected sub Application_PreRequestHandlerExecute(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_PreRequestHandlerExecute" + "<br/>") end subprotected sub Application_PreSendRequestContent(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_PreSendRequestContent" + "<br/>") end subprotected sub Application_PreSendRequestHeaders(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_PreSendRequestHeaders" + "<br/>") end subprotected sub Application_ReleaseRequestState(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_ReleaseRequestState" + "<br/>") end subprotected sub Application_ResolveRequestCache(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_ResolveRequestCache" + "<br/>") end subprotected sub Application_UpdateRequestCache(ByVal Sender as Object, _ ByVal e as EventArgs) Response.Write("Application_UpdateRequestCache" + "<br/>") end subsub WriteFile(strText as string) response.write("inside WriteFile <br>") end sub </script> ****************************************************************** Do I need to do something else to make this work? It is a straight global.asax file in the root folder that is executing correctly on my aspx page (except for the sub). At the moment I am passing a string, but since I couldn't get it to work I just put a response.write line in the sub. Thanks, Tom tshad wrote:
> I have an example I copied from "programming asp.net" (o'reilly) and There was no way for you to know it, but this is a classic asp newsgroup.While you may be lucky enough to find a dotnet-savvy person here who can answer your question, you can eliminate the luck factor by posting your question to a group where those dotnet-savvy people hang out. I suggest microsoft.public.dotnet.framework.aspnet. > can't seem to get the Sub (writefile) to execute. It displays all the The Response object is usually not available in any of these event > response.write lines that are called directly, but not any of the > response.write lines from inside the sub. procedures, at least in classic asp, and I assume it's the same in dotnet. Bob Barrows -- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM" "Bob Barrows [MVP]" <reb01501@NOyahoo.SPAMcom> wrote in message Actually, I do use the .net group, but I accidently posted it here. Sorry.news:OCjsffdGFHA.400@TK2MSFTNGP14.phx.gbl... > tshad wrote: >> I have an example I copied from "programming asp.net" (o'reilly) and > > There was no way for you to know it, but this is a classic asp newsgroup. > While you may be lucky enough to find a dotnet-savvy person here who can > answer your question, you can eliminate the luck factor by posting your > question to a group where those dotnet-savvy people hang out. I suggest > microsoft.public.dotnet.framework.aspnet. Tom Show quote > >> can't seem to get the Sub (writefile) to execute. It displays all the >> response.write lines that are called directly, but not any of the >> response.write lines from inside the sub. > > The Response object is usually not available in any of these event > procedures, at least in classic asp, and I assume it's the same in dotnet. > > Bob Barrows > -- > Microsoft MVP - ASP/ASP.NET > Please reply to the newsgroup. This email account is my spam trap so I > don't check it very often. If you must reply off-line, then remove the > "NO SPAM" > |
|||||||||||||||||||||||