Datagrid with session problem
-
Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks
-
Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks
-
You can store the complete data in session and then you can bind your controls after getting the data from session in the second page.
Best Regards, Apurva Kaushal
Pls tell me How can i Do?
-
Pls tell me How can i Do?
Fetech complete data in a dataset and then pass that to a session variable, i guess it will work. Session["myData"]=DatSet
Naveed Kamboh Complexity kills, Write easy code for your self. isolutionteam
-
Hi I have a Datagrid and Button controls in a webform I am displaying Dept Details in Webform1.But when I click Button Then Entire Details should display in webform2 using sessions How? Thanks
If the button is inside the datagrid then it is fairly easy. what you have to do is to hook the ItemCommand or RowCommand (in case you have Gridview). The following code may help you the CommandArgument property is inialized with the Id filed value in your table. you may then right the following code in RowCommand event protected void gw_RowCommand(object sender, GridViewCommandEventArgs e) { int ID = Convert.ToInt32(e.CommandArgument.ToString()); Session["ID"]=ID.ToString(); Response.redirect("http:detail.aspx"); } After the page is redirected to detail page there you should retrieve the ID value from the session as Integer Code=Convert.ToInt32(Session["ID"].ToString()); you can then use the Code to query your database and retrieve the datail best luck