Click here to Skip to main content
16,021,181 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how i can compare the value from database and the value from the url of our page in asp.net.

i have to create registration form and then i send the messge to the particuler regstered person and also send the link and that link have some id passed that id and the id of in database is same then that user were enable stste...

and either disable to use that acount
so if they are enable so,further they are cliclk on that link and acessing or use that page which i have provided in link....pls send me ans...
Posted
Updated 3-Mar-13 15:16pm
v2

1 solution

You can get User Name & Password which you hae sent to user as query string. Read the query string & compare those values with data base values. If value's are matching then user is valid user & then you can enable this user.

So if you are having something like user confirmation page(This is the link you are going to send to user.. htt://localhost/UserConfirmation.aspx?UserName="Test"&Password="1234"),on Page_Load you can check the values,

string userName = Request.QueryString["UserName"];
string password = Request.QueryString["Password"];


// add logic to get data from database // -> You can send this username & password to database & check if there is any user present if yes its valid user.

i.e. select userName from UserTable where username = userName and password = password

If this query gives one result record then user is valid you can enable that user.


Please Note :- Its advised that when you send data in querystring try to encrypt it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900