I have a textbox(txtSearch) and button(search) and one link button. First I enter some name in the textbox and click the Search button(username is getting assigned) and click on the link button.
Now username parameter value is not getting passed from searchbutton_click event to linkbutton_click event? How can i achieve this?
public partial class Users: System.Web.UI.Page
{
public string username = string.empty;
protected void Page_Load(object sender, EventArgs e)
{
}
public void SearchButton_Click(object sender, EventArgs e)
{
username = txtUser.Text.ToString();
}
protected void linkButton_Click(object sender, EventArgs e)
{
response.write(username) \\here username is coming as empty string.
}
}