By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,574 Members | 1,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,574 IT Pros & Developers. It's quick & easy.

Problem using Response.Redirect from a User Control

P: n/a
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 error:
Response is not available in this context.
I am assuming this is due to the fact that I am calling the method from the
User Control rather than the Page. If I use context.Response.Redirect I am
given the following error:
Cannot redirect after HTTP headers have been sent.
However, I do not know of any other way to programmatically send the user to
another URL. What can I do to either make the Response.Redirect method work
from a User Control, or what is another simple way to programmatically send
the user to another page? Thanks.
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
try

server.transfer("fishpage.aspx");
Nov 19 '05 #2

P: n/a
That takes me to the desired page, however, I did not want to use it because
it does not change the displayed URL in the browser's Address Bar. This is a
problem in my application because the buttons that will be calling the
method are the primary navigation buttons. If I used Server.Transfer every
page on my entire site would have exactly the same URL. This would prevent
users from bookmarking and/or adding pages to their favorites.

--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/
"Josh" <s@a.com> wrote in message
news:%2****************@TK2MSFTNGP15.phx.gbl...
try

server.transfer("fishpage.aspx");

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.