How to show the previous selected checked box in previous page in asp.net
-
I m making an online examination page on this page i created a gridview with paging when i go on next page thn aftr selecting options of answer of any question i m going on to another page. but when i come back on this previous page i cant see the previously selected answers the gridview page is refreshed thn, Please help me in it.
<body>
<label id="tim" style="font-size:15px;"></label> </body>
and here is my c# code in gridview paging
protected void examgrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
DBClass db = new DBClass();//hidvalue.Value = Convert.ToString(x); for (int i = 0; i < examgrid.Rows.Count; i++) { Label question = (Label)examgrid.Rows\[i\].Cells\[0\].FindControl("ques");
-
I m making an online examination page on this page i created a gridview with paging when i go on next page thn aftr selecting options of answer of any question i m going on to another page. but when i come back on this previous page i cant see the previously selected answers the gridview page is refreshed thn, Please help me in it.
<body>
<label id="tim" style="font-size:15px;"></label> </body>
and here is my c# code in gridview paging
protected void examgrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
DBClass db = new DBClass();//hidvalue.Value = Convert.ToString(x); for (int i = 0; i < examgrid.Rows.Count; i++) { Label question = (Label)examgrid.Rows\[i\].Cells\[0\].FindControl("ques");
Generally the implementation is to rebind the grid on page change that leads to loss of any selection made. If you want to persist selection across various pages, you need to maintain the selection somewhere or use client side pagination avoiding rebind on page change. Following article demonstrates one of the ways to handle it: Maintaining States of Selected CheckBoxes in Different Pages inside the GridView[^]
Sandeep Mewara Microsoft ASP.NET MVP 2012 [My Latest Article(s)]: How to extend a WPF Textbox to Custom Picker Server side Delimiters in ASP.NET
-
Generally the implementation is to rebind the grid on page change that leads to loss of any selection made. If you want to persist selection across various pages, you need to maintain the selection somewhere or use client side pagination avoiding rebind on page change. Following article demonstrates one of the ways to handle it: Maintaining States of Selected CheckBoxes in Different Pages inside the GridView[^]
Sandeep Mewara Microsoft ASP.NET MVP 2012 [My Latest Article(s)]: How to extend a WPF Textbox to Custom Picker Server side Delimiters in ASP.NET
thnks bro
-
thnks bro
If i have to give an opinion,i'll say that use javascript to store the value corresponding to the question no and show that everytime. By default keep nothing in the radiobutton. Hope this helps.