RequiredFieldValidator and Page.Response.Redirect

R

RobertTackett

I have created a web page that has a textbox with a RequiredFieldValidator assigned to it, one button for posting the form and adding the value to a database and another button for redirecting the user to another page. The redirect button won't work unless I enter a value in the textbox or remove the RequiredFieldValidator. I would like to validate the field only in the case of a post and not when the user wants to go to another page. Can you help me please

Thank you

Robert Tackett
 
T

Teemu Keiski

Hi,

the button which shouldn't cause validation, can be set with
CausesValidation="False" attribute.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke


RobertTackett said:
I have created a web page that has a textbox with a RequiredFieldValidator
assigned to it, one button for posting the form and adding the value to a
database and another button for redirecting the user to another page. The
redirect button won't work unless I enter a value in the textbox or remove
the RequiredFieldValidator. I would like to validate the field only in the
case of a post and not when the user wants to go to another page. Can you
help me please?
 

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

No members online now.

Forum statistics

Threads
474,266
Messages
2,571,082
Members
48,773
Latest member
Kaybee

Latest Threads

Top