Implementing a cancel button

G

Guest

Hi;

I am guessing how to do this is very easy - but I can't find it anywhere. I
have a cancel button on my form and if the user clicks it, I want to perfomr
no validation and redirect to a specific page with the browser url showing
the page redirected to.

How can I do this?
 
G

Guest

Hi;

First off thank you - that answers how to avoid the validation.

Other question - how do I have it redirect to another page on the click?
 
G

Guest

Upon Button_Click event you would use the Response.Redirect with any of its 2
forms of syntax that are available:
http://msdn2.microsoft.com/en-us/library(d=robot)/system.web.httpresponse.redirect.aspx

1- HttpResponse.Redirect (String) Redirects a client to a new URL and
specifies the new URL.

2- HttpResponse.Redirect (String, Boolean) Redirects a client to a new URL.
Specifies the new URL and whether execution of the current page should
terminate.

e.g. Response.Redirect("page1",true)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,588
Members
45,092
Latest member
vinaykumarnevatia1

Latest Threads

Top