Pass ASP.Net GridView from one page to another page

前端 未结 6 1668
终归单人心
终归单人心 2021-01-12 13:59

I want to pass all the gridview value into another page I have one gridview in PatientDetails.aspx page and one button as below



        
6条回答
  •  無奈伤痛
    2021-01-12 14:50

    Try using Session Variables. You can set the GridView into a Session variable that can then be retreived later so long as the same session is still active.

    You can use the following code to set the Session Variable on your first page :

    Session["gvDoctorList"] = gvDoctorList;
    

    And then to retreive from the variable on your second page :

    GridView gvDoctorList = (GridView)Session["gvDoctorList"];
    

    For more information on Sessions see the MSDN Session State Overview.

提交回复
热议问题