I have page for searching with GridView
I want to save the whole GridView
such filter, sort and page after searching to session is there a way to do it?
Asked
Active
Viewed 36 times
0

sarah khaled
- 91
- 9
-
2This is somewhat related to [this question](http://stackoverflow.com/questions/9214670/saving-webcontrols-in-the-session-object) and the answer I would go with is the first one, which is to not save the entire grid and all the controls but just the parameters you need to rebuild the page (like search textbox values, etc.). – ourmandave Dec 04 '15 at 19:27
-
@ourmandave my purpose is when user left page to go next page then he return to previous page which is gridview I want to be same result of search in gridview so I'm thinking to save all values from TextBox to session in method Search_Click then in page_load I do this if(Session["name"] != null) {txtName.Text = Session["name"].ToString(); gridview.dataBind();} but it will not work, so I want something to pass these values to EntityDataSourceName.Where="values from session" How I can pass values to EntityDataSourceName.Where? do you have any idea? – sarah khaled Dec 04 '15 at 20:40
-
1Would [this answer](http://stackoverflow.com/a/5463934/3585500) work? The example is using the user login name but you could say, `MyEntityDataSource.WhereParameters["Name"].DefaultValue = txtName.Text;`. Also see the last answer on [this page](http://forums.asp.net/t/1835939.aspx?Passing+input+parameters+to+the+EntityDataSource) to use a session parameter. – ourmandave Dec 04 '15 at 23:15
-
Thank you very much it help me, I don't know before we have something asp:sessionParameter let me try tomorrow and I will give you my result – sarah khaled Dec 05 '15 at 07:37
-
@ourmandave thank you it's work now – sarah khaled Dec 06 '15 at 13:10