tinomesa Posted July 14, 2003 Posted July 14, 2003 Greetings, The following may be imposible to do, but Iwould appreciate any help or comment ..... I have an ASP.Net application with heavy database workload, I am trying to load a user-control onto the requesting page thru an HttpModule onBeginRequest event, I am planning on disposing of the object onRequestEnd. The purpose of this is to present the user with a message "Please Wait .... Data Procesing" and an animated gif packaged into a control, while the request is being processed. This is the code so far in the Module.... Public Sub thebegining(ByVal s As Object, ByVal e As EventArgs) Dim mycontrol As splashcntl = New splashcntl() Ctx.Current.Application.Add("splashcntl", mycontrol) End Sub I can't flush the response here because the session ID has not yet been written to the cookie, and I am not sure how to get this object to the requesting page pre-procesing. If you know a way or if you know a different approach I would appreciate your direction. Quote
WebJumper Posted July 14, 2003 Posted July 14, 2003 While your are loading from DB, you can't "write" any html to the client. This is all server-side and your data you read from your sql or similar will be written into HTML like <div>Some text</div> or textboxes... The only thing you can do: befor datarequest open with javascript a window (with message...), reload the current page and close the window with the message when you have all data loaded and generated the new html-page. Quote
tinomesa Posted July 14, 2003 Author Posted July 14, 2003 Hello WebJumper, I understand what you are saying, but it seems to me that there must be a way to send a response to the browser while or (prior to) processing the request. I am thinking that it must be in a asynchcronous manner. I got the following code now but I get a message that the user control I am trying to load is not in the same application context as the request being process (I think) Public Sub thebegining(ByVal s As Object, ByVal e As EventArgs) Dim app As HttpApplication = CType(s, HttpApplication) Dim mycontrol As UserControl = New UserControl() mycontrol.LoadControl("splash.ascx") app.Context.Current.Items.Add("Item1", mycontrol) app.Context.Response.Write(mycontrol) . . . Again you are probably wrigth! Anyways, If anyone can tell me why I am geting this error message... [HttpException (0x80004005): The virtual path '/splash.ascx' maps to another application, which is not allowed.] System.Web.HttpRequest.MapPath(String virtualPath, String baseVirtualDir, Boolean allowCrossAppMapping) System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context) +99 System.Web.UI.TemplateControlParser.GetCompiledType(String virtualPath, String inputFile, HttpContext context) System.Web.UI.UserControlParser.GetCompiledUserControlType(String virtualPath, String inputFile, HttpContext context) System.Web.UI.TemplateControl.LoadControl(String virtualPath) APLoad.splashcntl.thebegining(Object s, EventArgs e) in C:\Inetpub\wwwroot\APLoad\Classes\splashcntl.vb:24 System.Web.SyncEventExecutionStep.Execute() +60 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +87 Thanks!! Quote
whitenack Posted August 20, 2003 Posted August 20, 2003 (edited) I found other articles on this same issue: http://www.dotnet247.com/247reference/msgs/13/65919.aspx http://wintellect.com/forum/topic.asp?TOPIC_ID=417&ARCHIVE= For me, when I moved my aspx out of the Application folder, the problem went away. Edited August 20, 2003 by whitenack Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.