473,385 Members | 1,798 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,385 software developers and data experts.

Response is not available in this context error on a page

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 is not available in this context.

I tried to write this as HttpContext.Current.Response.Write("Hello World") but again it gives save error?

Don't we get the Response object on page unload.
Mar 13 '08 #1
2 8755
saran23
28
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 is not available in this context.

I tried to write this as HttpContext.Current.Response.Write("Hello World") but again it gives save error?

Don't we get the Response object on page unload.
try using Javascript, I think its possible with only Javascript, when the page gets unloaded the memory for the objects used is cleared, so u might not get Response.Redirect work.
Mar 13 '08 #2
kunal pawar
297 100+
on unload event, it dispose all resources to it is not possible to used response object in that context
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

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: rao | last post by:
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...
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...
7
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi everybody, I'm using a system.timers.timer object like this: Dim aTimer As New System.Timers.Timer() In my page_load event I use this: aTimer.Interval = 5000 aTimer.Enabled = True...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.