Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Problem using Response.Redirect from a User Control

Reply
Thread Tools

Problem using Response.Redirect from a User Control

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      05-25-2005
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

http://www.nathansokalski.com/


 
Reply With Quote
 
 
 
 
Josh
Guest
Posts: n/a
 
      05-25-2005
try

server.transfer("fishpage.aspx");


 
Reply With Quote
 
 
 
 
Nathan Sokalski
Guest
Posts: n/a
 
      05-25-2005
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

http://www.nathansokalski.com/
"Josh" <> wrote in message
news:%...
> try
>
> server.transfer("fishpage.aspx");
>



 
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
User Control to Control Other User Control Jonathan Wood ASP .Net 4 02-02-2010 03:41 PM
Problem using ASP Wizard Control in User Control Lasse ASP .Net Web Controls 0 05-30-2006 11:17 PM
persisting changes to a control outside a user control from the user control? Mad Scientist Jr ASP .Net 0 03-22-2006 08:02 AM
Event not firing for user control inside user control vatech1993 ASP .Net 4 12-11-2004 02:51 PM
Manipulating a User Control from another User Control Tom Rowton ASP .Net 2 08-01-2003 08:18 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57