472,119 Members | 1,271 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 10595
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
reply views Thread by leo001 | last post: by

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.