Click here to Skip to main content
15,887,856 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have 3 pages: Available stock, Expired stock and Returned stock. From available stock i get selected rows from gridview and redirect to Returned stock. here extra parameters are updated . Similarly i wanna redirect from expired stock to returned stock with selected gridview rows. How to modify the below code?

C#

public partial class Returnedstock : System.Web.UI.Page
    {
       

protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {

                if (Session["AvailableStock"] != null || Session["Expiredstock"] != null)
                {
                    BindGrid();
                }

            }
        }
 void BindGrid()
        {
            if (Session["AvailableStock"] != null)
            {
                DataTable dtselectedRows = Session["AvailableStock"] as DataTable;
                
                GridView1.DataSource = dtselectedRows;
                GridView1.DataBind();
            }
            else if (Session["Expiredstock"] != null)
            {
                DataTable dtselectedRows = Session["Expiredstock"] as DataTable;
                 GridView1.DataSource = dtselectedRows;
                GridView1.DataBind();
            }
            
        }
Posted
Comments
ZurdoDev 28-Apr-15 14:51pm    
Use Response.Redirect(page) to go to a different page.

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