Paging on GridView
<p>I'm stuck at the moment on how to show my Grid Data in another page.</p>

<p>Basically I have a GridView name "gdvRiders" with Paging Enabled. The problem is when I click on Page 2, I get a blank Page with no Data. Can someone help me? I'm starting to learn c#</p>

<p>Here is my code:</p>

<pre><code>protected void Page_Load(object sender, EventArgs e)
    {
        DataBase db = new DataBase(true);
        string strSQL;
        DataTable dt;

        if (!IsPostBack)
        {
            strSQL = "SELECT r.surname, r.firstname, cn.country, r.age, f.flagurl " +
                     "FROM (Riders r INNER JOIN par_CountryNation cn ON r.countryid = cn.countryid) INNER JOIN par_Flags f ON cn.flagid = f.flagid ";

            dt = db.getDataTableAc(strSQL, "list_Riders");

            gdvRiders.DataSource = dt;
            gdvRiders.DataBind();

        }

    }

    protected void gdvRiders_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
            gdvRiders.PageIndex = e.NewPageIndex;
            gdvRiders.DataBind();

    }
}
</code></pre>
