Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Going back to calling page

Reply
Thread Tools

Going back to calling page

 
 
BillGatesFan
Guest
Posts: n/a
 
      01-03-2005
Let's say I'm in a.aspx and I do a response.redirect to b.aspx. Then I
show and hide a couple of panels in b.aspx and now I want to click a
button to take me back to a.aspx. how do I do that without doing
response.redirect?

 
Reply With Quote
 
 
 
 
Marina
Guest
Posts: n/a
 
      01-03-2005
What's wrong with Response.Redirect?

"BillGatesFan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Let's say I'm in a.aspx and I do a response.redirect to b.aspx. Then I
> show and hide a couple of panels in b.aspx and now I want to click a
> button to take me back to a.aspx. how do I do that without doing
> response.redirect?
>



 
Reply With Quote
 
 
 
 
John Timney \(ASP.NET MVP\)
Guest
Posts: n/a
 
      01-03-2005
You can use the meta tags or javascript to move the page client side, or
server.transfer server side...I would redirect to the referrer.
--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"BillGatesFan" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) oups.com...
> Let's say I'm in a.aspx and I do a response.redirect to b.aspx. Then I
> show and hide a couple of panels in b.aspx and now I want to click a
> button to take me back to a.aspx. how do I do that without doing
> response.redirect?
>



 
Reply With Quote
 
Bill Gates Brother
Guest
Posts: n/a
 
      01-03-2005


The problem with it was I needed to go back to the correct page. My
example was kind of wrong. I'm on c.aspx, a.aspx and b.aspx could get to
c.aspx. How do I get back to the correct one that got me to c.aspx? If I
knew which one, then I could use response.redirect.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
jongalloway
Guest
Posts: n/a
 
      01-04-2005
One method is to add the referer to Viewstate the first time the page
is loaded (Postback == false). This example uses a button, but once you
have the referer you can do whatever you want with it.

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
BackPath = Request.UrlReferrer.ToString();
ViewState.Add("BackPath", BackPath);
}
else
{
BackPath = ViewState["BackPath"].ToString();
}
}

private void btnBack_Click(object sender, System.EventArgs e)
{
Response.Redirect(BackPath, false);
}

There are some other, more sophisticated approaches. Juval Lowy has
written a server control that handles this functionality:
http://www.ftponline.com/vsm/2003_07...ne/columns/qa/
- Jon
http://weblogs.asp.net/jgalloway

 
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
Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up." Midex Python 24 05-07-2007 04:23 AM
Maintaining "ViewState" Going to Another Page and Back Steve Murphy ASP .Net 2 01-15-2006 04:11 AM
How to keep entries intact when going BACK to a web page =?Utf-8?B?TmFk?= ASP .Net 6 06-30-2005 01:51 PM
Forms Authentication going back to previous page tshad ASP .Net 4 02-01-2005 12:23 AM
avoid a page going back to site after logging out nvv via DotNetMonster.com ASP .Net 2 01-27-2005 09:12 PM



Advertisments