473,385 Members | 1,593 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Validate form

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
Nov 18 '05 #1
1 1046
Make sure u have CausesValidation="False" in ur button
Btw go to :- http://samples.gotdotnet.com/quickstart/aspplus/
And read through :- Server Control Form Validation
Hope this helps!!


"Rajani" <Ra****@discussions.microsoft.com> wrote in message
news:F1**********************************@microsof t.com...
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

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Techy | last post by:
I have two fields in my form so called : invoice and cash Now I want to validate this form on the client side with the help of javascript in such a way that if one of these fields is empy an...
4
by: Alonso | last post by:
Hello everybody! :-D I am trying to validate a select object in a form. It does not work fine in Explorer 6.0 because it always send the form, but in Netscape 7.0 it works really fine. The code...
4
by: Wysiwyg | last post by:
I need to validate a form to ensure that all of the fields add up correctly. I can't do this while the user is entering data since validation needs to be done after the entry is completed. What's...
3
by: Martin | last post by:
Hi, I am implemeting a form in asp.net. The form is quite large and the validation is reasonably complex, so I have decieded to implement my own validation rather than use any custon...
9
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say...
11
by: jjbutera | last post by:
I know how to use the ErrorProvider in my winforms..or do I? I validate the values and set the ErrorProvider in the validating event. If not valid, I set e.Cancel = True. I clear the ErrorProvider...
11
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
4
by: Brybot | last post by:
I have a form that i've split up into multiple asp:panels, each panel has a number of validators which work correctly. At on the last panel, i want to commit the data collected to a database. I...
1
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
1
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.