i have two .aspx page, first(home) page having a label1 and second (register)page having user name and passwrod now i want when anyone fill that register form and click that button the user name which he entered in first textbox should be show on the label1 which is on the first(home) page.
waiting... help me hurry
Thanks
Chester !
Asp.net control reference
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Nov 26, 2009, 5:58 AM EST
if my answer helps you then check "Do you like this answer" check box :)
Page 1 Code
----------------
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Username"] != null)
{
Label1.Text = Session["Username"].ToString();
}
}
Registration Page's Code
----------------------
protected void button1_Click(object sender, EventArgs e)
{
Session["Username"] = txtUsername.Text.Trim();
Response.Redirect("Page1.aspx");
}
shyamala37 reputationPosted Nov 27, 2009, 12:16 AM EST
protected void button1_Click(object sender, EventArgs e)
{
session["username"]=TextBox1.Text;
}
in home page
protected void Page_Load(object sender, EventArgs e)
{
if (Session["username"].ToString() != "")
{
dt = con.DBExecute("select username from tablename");
Label1.text=dt.Rows[0]["username"].ToString();
}
}
one info:if u r using session means no need to pass the value via response.redirect