how i can create a "User Account" for each user based upon his username?

Posted by Shreesh under ASP.NET on 10/22/2011 | Points: 10 | Views : 979 | Status : [Member] | Replies : 1
hello,
can anyone tell me how i can create a "User Account" for each user based upon his username? since i am new to this ,i have tried using sessions but i'm getting an error "Object reference not set to an instance of an object."

Session["uname"] = TextBox1.Text;
Session["pass"] = TextBox3.Text;
Label8.Visible = true;
cmd.ExecuteNonQuery();

the above code is in the registration page.

Label4.Visible = true;
Label4.Text = Request.QueryString.ToString();
Response.Write("welcome" + Session["uname"].ToString());


this is the code in the next page.please suggest some tips.




Responses

Posted by: Abdulhaknet on: 10/25/2011 [Member] Starter | Points: 25

Up
0
Down
hi friend,
when register new user?
------------------
1. check the user for exists in database. if not found then store it to databse and added to session variable.and redirect to homepage.
2. if exists redirect the user with error page.

when login?
----------------------------------------------------------
1. check the user for exists in database. if found then added to session variable.and redirect to homepage.
2. if not found then redirect the user with error page.



if "Object reference not set to an instance of an object." comes means session variable is accessed without initialize the variable.

Shreesh, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response