Using QueryString for passing the text of button to other page.
--Button.aspx.cs---
<pre lang="cs">using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class button : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string abc = "";
abc = btn1.Text;
Session["button"] = abc;
}
protected void btn1_Click(object sender, EventArgs e)
{
Response.Redirect(
"Default.aspx
?button="+btn1.Text);
}
}
----------Default.aspx.cs------
<pre lang="cs">using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
lbl2.Text =Request.QueryString["button"].ToString();
}
protected void btnsubmit_Click(object sender, EventArgs e)
{
}
}</pre>