Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I am trying to pass values from a page to next page. But its not getting passed. I need it to be done using session or anyother method where the value is hidden. This is what i tried.

Page 1 :
<pre lang="cs">protected void Button1_Click(object sender, EventArgs e)
{
    Session["Name"] = GridView1.FooterRow.Cells[3].Text;
    Response.Redirect("~/memberpages/checkout.aspx");
}



And Page 2 :
<pre lang="cs">protected void Page_Load(object sender, EventArgs e)
{
    if (Session["Name"] != null)
        TextBox1.Text = Session["Name"].ToString();
}



Edit :
i think i missed something in the question... its actually i have a value in the 3rd column of the footer row in gridview which i need to pass to next page.. is that code which i used is correct...
Posted
Updated 29-Jan-11 5:32am
v2

Debug and check if GridView1.FooterRow.Cells[3].Text; does indeed have a value.
 
Share this answer
 
Comments
sharathu7 29-Jan-11 11:32am    
i think i missed something in the question... its actually i have a value in the 3rd column of the footer row in gridview which i need to pass to next page.. is that code which i used is correct...
 
Share this answer
 
Comments
sharathu7 29-Jan-11 11:42am    
Sorry ... for this.. its actually my mistake.. i have given postback url for the button1 in its property.. which made it to transfer without the values...

anyway thanks for ur quick reply...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900