1. It is simple. Just cache it (into user
session
), or send (by using
query string
) the value input into the textbox and used it in the
Page_Load
event of the other web page to init its label.
2.Example:
protected void SaveButton_Click(object sender, EventArgs e)
{
string userName = _userNameTextBox.Text.Trim();
Session["UserName"] = userName;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
string userName = (Session["UserName"] == null ? string.Empty : (string)Session["UserName"]);
_userNameLabel.Text = userName;
}
}