Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Response is not available in this context - page blowing

Reply
Thread Tools

Response is not available in this context - page blowing

 
 
rao
Guest
Posts: n/a
 
      08-27-2004
Hi

I am generating unique xml files and deleting them in page_unload event.
Application responds properly in normal conditions. When I keep clicking
on url that invoke the page several times the application blow up with
following error "Response is not available in this context". This happens
only when I keep clicking on link for stress test. Here is the code I process
on page_unload event. Any suggestions are welcome.


Thanks
Rao


private void Page_UnLoad(object sender, System.EventArgs e)
{
try
{
if (File.Exists(Server.MapPath(xmlDocPath+ProjectsDoc )))
{
File.Delete(Server.MapPath(xmlDocPath+ProjectsDoc) );
}
if (File.Exists(Server.MapPath(xmlDocPath+ResourcesDo c)))
{
File.Delete(Server.MapPath(xmlDocPath+ResourcesDoc ));
}
}
catch(Exception ex)
{Response.Write(ex.Message.ToString());}
}
 
Reply With Quote
 
 
 
 
Karl
Guest
Posts: n/a
 
      08-27-2004
The error message is pretty clear, Response isn't available in the context.
In other words, you can use Response.Write in the Page_Unload event. The
only relation that this has to your fast clicking is that it's causing an
exception to be thrown.

Karl


"rao" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m...
> Hi
>
> I am generating unique xml files and deleting them in page_unload event.
> Application responds properly in normal conditions. When I keep clicking
> on url that invoke the page several times the application blow up with
> following error "Response is not available in this context". This happens
> only when I keep clicking on link for stress test. Here is the code I

process
> on page_unload event. Any suggestions are welcome.
>
>
> Thanks
> Rao
>
>
> private void Page_UnLoad(object sender, System.EventArgs e)
> {
> try
> {
> if (File.Exists(Server.MapPath(xmlDocPath+ProjectsDoc )))
> {
> File.Delete(Server.MapPath(xmlDocPath+ProjectsDoc) );
> }
> if (File.Exists(Server.MapPath(xmlDocPath+ResourcesDo c)))
> {
> File.Delete(Server.MapPath(xmlDocPath+ResourcesDoc ));
> }
> }
> catch(Exception ex)
> {Response.Write(ex.Message.ToString());}
> }



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
return HttpStatusCode.ServiceUnavailable in the context.context.Response.StatusCode (Http response code 503) Flip Rayner ASP .Net 1 01-23-2007 06:35 AM
Why i get this error: Response is not available in this context Pepehammer ASP .Net 5 05-04-2006 12:18 AM
RE: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?= ASP .Net 0 06-07-2004 07:11 AM
Re: Web page is not available - "The Web page you requested is not available offline. To view this page, click Connect" Natty Gur ASP .Net 0 06-06-2004 05:46 AM
Re: Response is not available in this context MS News \(MS LVP\) ASP .Net 0 08-06-2003 11:05 PM



Advertisments