Validate form

G

Guest

Hello,

I am learning asp.net and i have experience in asp. I am using VS.NET for
developing dotNET pages.
Its login form. I placed two asp:textbox s for userid and password. and one
button(html server control) and one asp:label

How to vallidate whether the user has entered userid and password or not. If
not display an error message in the label. And also placed a button(html
server control) to redirect to my home page.
I wrote the code response.redirect("default.htm")
But its not redirecting. In the submit button also i wrote the code

private sub button2_serverClick(ByVal sender as System.object,ByVal e as
System.EventArgs)
if txtUID.value="" then
errlbl.text="Enter User ID"
end if
end sub

Can u explain me how to do this. I tried with requiredfieldvalidator control
also. If i click home button also its checking for errors and not performing
actual action(redirect to home page).


Thanx in advance
 

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
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top