.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

Creating Validation in ASP.net

Posted By: Vikneshwar     Posted Date: February 24, 2012    Points:5   Category :ASP.Net
Im creating a web page, im new to programming, i have created the pages,
now in the design part i have two textboxes:

1. enter user name
2. enter passowrd

i have to navigate to a different page when the user name and password matches with the datas that exists in a table that i have already created.

i tried but the page still navigates when when i just randomly enter some user name and password.

But this is not working provide me with an idea.

Author: kamlesh             
Posted Date: February 28, 2012     Points: 20   

Check below sites


Thanks And Regards.
Kamlesh Nikam
Author: Pawan Awasthi             
Posted Date: March 25, 2012     Points: 20   

Hai Vikneshwar,

There are two types of validations you can use in your application:
1. Client Side validations
2. Server Side validations

The client side validations are that validation s where the control validates at the client side before sending the data to the server.
For the Client side validations we use the scripting languages like JavaScript, VBScript etc as these are scripting language so they ruins at the client side. If the validation fails then the page won’t get posted to the server so the response time for your website increases as well the user experience of the page also increases.
Server side validations are those where the validations re done at the server side. It means the validation doesn’t perform at the client side. It won’t check the data at the client side. Whenever any post back happens, the data goes to the server and there the validations gets performed and if fails then the page again reload to the client. This is good when the client sides validations are disabled by your browser then the server side validations are beneficial.
Mostly we use the Client side validations.
As per your issue, you want to check for the user name and password and if it is valid then redirect to the next page but you didn’t write that what kind of validation you need here? Are you checking for the mandatory fields? If the user has not written the user name and password, should it go to the server? Should it be redirect still?
OR in the button click event you wan to check the user name and password from the database and if it is not correct then be at the login page itself? If this is the scenario then probably you need to check and return the Boolean true or false from your database and based on it, you can show the message that "user name/password is invalid". And be at this page itself.
So if you can provide the code snippet which you are using for the validation, then we can help you in better way,
Hope it will help to you.

Pawan Awasthi
(Whats App)+91 8123489140
(cell No.) +6 0143651476

Skype: Pawansoftit

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend