username log in program in c#?
i want code to log in username code when the username write his name and press submit there will be text block that change to welcome" the user name "
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Iftikar HussainPosted Jun 21, 2013, 12:11 AM
You can use the above solution for the same. Lets say in WebForm1.aspx you have text box named TxtBxUserAddress.Text. Then in that page you have Save or Any button by which you will read the textbox value in code behind and store it in Application variable. Like
BtnSave_Click(object obj,EventArgs e)
{
Application["UserAddress"]=TxtBxUserAddress.Text;
}
Now you redirect to another page say WebForm2.aspx, in that inside Page_Load event you can read the value from Application and display to the Label
in WebForm2.aspx
Page_Load(object obj, EventArgs e)
{
LblUserAddress.Text=Convert.ToString(Application["UserAddress"]);
}
Let me know if you need still more information.
Regards,
Iftikar
Remember to click "Mark as Answer" on the post, if it helps you.
amr kamalPosted Jun 20, 2013, 8:11 PM
Iftikar HussainPosted Jun 19, 2013, 1:02 AM
Are you doing this in WebApplication? If yes, then after submitting the User Name you can store in Application variable. Then in your page just read the value from the Application variable and display it. Like below
In Login.aspx, after click on Submit button
protected void BtnSubmit_Click(object sender, EventArgs e)
{
Application["UserName"]=TxtBox1.Text;
}
In your main page like Home.aspx
protected void Page_Load(object sender, EventArgs e)
Please let me know if you need more information
Regards,
Iftikar
Remember to click "Mark as Answer" on the post, if it helps you.
Pankaj PandeyPosted Jun 19, 2013, 12:51 AM
take a label and write the code..
Label1.Text="welcome "+TextBox1.Text;
Sanjeeb LenkaPosted Jun 18, 2013, 10:37 AM
http://dotnetdots.wordpress.com/2013/04/24/simple-login-application-in-windows-c/
Any problem rply