I working with c#(asp.net) and i have created a.aspx ,b.aspx,c.aspx like that three different pages….
I’m using the following code in
a.aspx
<asp:TextBox ID="txt" runat="server"></asp:TextBox>
<asp:TextBox ID="txt1" runat="server"></asp:TextBox>
<asp:Button ID="btn" runat="server" OnClick="OnClick" Text="Click" />
and code behind this page is as follows:
a.aspx.cs
protected void OnClick(object sender, EventArgs e)
{
Response.Redirect("b.aspx?Site=google&Code=123?Name=" + txt.Text+"&second="+txt1.Text);
}
after that i place two labels in b.aspx page…
and i’ve used the following code to receive that values…
b.aspx.cs
public String txt1
{
get
{
return Convert.ToString(Request.QueryString["txt1"]);
}
}
……
Now i want to access these values not only to b.aspx i want to pass those values to c.aspx
You can use session variable to hold all the values instead of putting it in query string. In this way you will be able to access these values from any page.
to set value-
Now you can access these values from any page- (b.aspx, c.aspx)