Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6362755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:57:00+00:00 2026-05-24T23:57:00+00:00

I having the page in that i have the gridview and page index changing

  • 0

I having the page in that i have the gridview and page index changing also for every record i have

a check box.on top of the page i have the imagebutton in that when i click that button i am redirecting it into another page
in that page i have a back button which redirects to present page with checkbox and gridview.

what should i do to retain to get the checkbox when ever i check or some thing else?

This is gridview paging:

  protected void ManageCalenderShift_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
    StoreOldValue();
    EmployeeDetails.PageIndex = e.NewPageIndex;
    SortedBindDataToGrid();
    PupulateoldCheckValue();
}
private void StoreOldValue()
{
    ArrayList categoryIDList = new ArrayList();
    foreach (GridViewRow row in EmployeeDetails.Rows)
    {
        Label can_id = (Label)row.FindControl("UserACENumber");
        bool result = ((CheckBox)row.FindControl("Chkgrid")).Checked;
        if (Session["CHECKED_ITEMS"] != null)
            categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
        if (result)
        {
            if (!categoryIDList.Contains(can_id.Text))
                categoryIDList.Add(can_id.Text);
        }
        else
            categoryIDList.Remove(can_id.Text);
    }
    if (categoryIDList != null && categoryIDList.Count > 0)
        Session["CHECKED_ITEMS"] = categoryIDList;
}
private void PupulateoldCheckValue()
{
    ArrayList categoryIDList = (ArrayList)Session["CHECKED_ITEMS"];
    if (categoryIDList != null && categoryIDList.Count > 0)
    {
        foreach (GridViewRow row in EmployeeDetails.Rows)
        {
            Label can_id = (Label)row.FindControl("UserACENumber");
            if (categoryIDList.Contains(can_id.Text))
            {
                CheckBox myCheckBox = (CheckBox)row.FindControl("Chkgrid");
                myCheckBox.Checked = true;
            }
        }
    }
}

This is the redirect to another page code that goes to page1:

protected void imgView_Click(object sender, ImageClickEventArgs e)
{
    StoreOldValue();
    PupulateoldCheckValue();
    Response.Redirect("page1.aspx?UserACENumber=" + (Server.UrlDecode(URLSecurity.Encrypt(UserContext.ACENumber))));

}

then in the “page1” i have back button which redirects to “page” aspx :

 protected void imgimgBack_Click(object sender, ImageClickEventArgs e)
{
    Response.Redirect("page.aspx?UserACENumber=" + (Server.UrlDecode(URLSecurity.Encrypt(UserContext.ACENumber))));
}

now my issue is:

when i check any one checkbox in the “page.aspx” and i go click image button and redirects to “page1.aspx” and come back to current working “page.aspx” whatever the checkbox i have checked gets disappear.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:57:01+00:00Added an answer on May 24, 2026 at 11:57 pm

    You will have to do that manually.

    Maintaining State of CheckBox while Paging in GridView

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a GridView that is customized by each page that uses it. The
I have a GridView that allows editing the values in every column, in every
I'm having to deal with some graphic items in a page that have <g>
The problem is, say, i am having a page xyz . And in that
im my web page having file upload option..it has to check two conditions. 1)whether
I have a page having certain pictures and i show around 20 pictures, kind
we have a Tiles layout page having Header, Menu, Body and Footer. In this
In VS 2008, I have an ASP.NET content page having one master page. I
I am working with an ASP.NET MVC application. I have one master page having
I have a page which has a GridView on it, which is populated from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.