473,412 Members | 2,239 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Response is not available in this context - page blowing

rao
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());}
}
Nov 18 '05 #1
1 2617
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" <ja********@hotmail.com> wrote in message
news:f2*************************@posting.google.co 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());}
}

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Stephen | last post by:
I was wondering if someone can help me with an web application design problem. I have a aspx page which builds up an arraylist called addresses and outputs the values in the arraylist items to a...
3
by: Farooq Khan | last post by:
why does Response.Write in a method of code-beind class when called from inpage code (i.e in <%---%>), after creating object of that class, fails when called while it works perfectly ok while...
5
by: Michael | last post by:
Hello, I have a separate Database class that handles any database work that all my asp.net pages can use. My problem is, many times I use try/catch to catch errors, and I want to output these...
5
by: Pepehammer | last post by:
Exception Details: System.Web.HttpException: Response is not available in this context. Source Error: Line 16: '---------- // SUB : WriteString Line 17: Public Sub WriteString(SayItNow as...
1
by: Asha | last post by:
hello, from my main page, i have an iframe which calls another .aspx file; and the other .aspx file will response.write values to it. but i keep getting the below message. can someone pleasehelp me...
7
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge...
2
by: Nathan Sokalski | last post by:
I am using the Response.Redirect method in a User Control to allow visitors to click an ImageButton to take them to another page. However, when I click the ImageButton I recieve the following...
2
by: maniishkumar | last post by:
I am writing a string as Response.Write("Hello world"); on Page_UnLoad() event. I am using ASP.NET with C#. When I execute this error and run the application I found this error that Response...
10
BeemerBiker
by: BeemerBiker | last post by:
I get that error message when trying to do a "Response.write()". I undoubtedly set up my classes wrong. My workaround is to put the offending code in each codebehind page. I would like to put the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.