469,350 Members | 1,712 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,350 developers. It's quick & easy.

How to go back to previous page in vb.net

Hi

I want go back to previous page if i click on cancel button.now i am going main page.I am using Response.Redirect(globals.navigateurl(),true)
its not working.In c# .net it is working fine.is it wrong i am doing please let me....
Dec 19 '06 #1
2 9989
bplacker
121 100+
if you really are trying to do this in vb.net, there is no such thing as a Reponse object, so therefore no such method called Redirect in a Response class.
Dec 19 '06 #2
kenobewan
4,871 Expert 4TB
Probably easiest to call JS:

Expand|Select|Wrap|Line Numbers
  1.  Me.BtnCancel.Attributes.Add("onclick", _
  2.                    "return window.go(-1)');")
Or similar. Response.Redirect still works for me. Something like:

Expand|Select|Wrap|Line Numbers
  1.  if( !IsPostBack )
  2.   {
  3.     ViewState["ReferrerUrl"]  = Request.UrlReferrer.ToString()
  4.   } 
  5.  
  6.   object referrer = ViewState["ReferrerUrl"];
  7.   if(referrer != null)
  8.       Response.Redirect((string)referrer);
  9.   else
  10.       Response.Redirect("Default.aspx");
Hope that this helps.
Dec 20 '06 #3

Post your reply

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

Similar topics

8 posts views Thread by Ralph Freshour | last post: by
25 posts views Thread by KK | last post: by
4 posts views Thread by Bratislav Jevtic | last post: by
8 posts views Thread by moondaddy | last post: by
2 posts views Thread by wiewiek | last post: by
1 post views Thread by Oscar Madrid | last post: by
2 posts views Thread by monomaniac21 | last post: by
8 posts views Thread by =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post: by
2 posts views Thread by =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.