Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
Gridview paging is working in IE10, but not working in Firefox 26.0.

My aspx
C#
<asp:GridView ID="gdAlert" runat="server" AutoGenerateColumns="false" CellPadding="5" CssClass="gridview" PageSize="5" AllowPaging="true" GridLines="None" HorizontalAlign="Center" BorderWidth="1" AutoGenerateEditButton="false" Width="100%" OnPageIndexChanging="status">
        <SelectedRowStyle CssClass="gridview-selected-row" />
                    <HeaderStyle CssClass="gridview-header" Font-Bold="false" />
                    <AlternatingRowStyle CssClass="gridview-alternate-row" />
                    <RowStyle CssClass="gridview-row" HorizontalAlign="left" />
                    <PagerSettings Visible="true" />
            <PagerStyle CssClass="gridview-pagination" />
            <EmptyDataTemplate>
            No data to display
            </EmptyDataTemplate>
             <SelectedRowStyle CssClass="gridview-selected-row" />
                    <HeaderStyle CssClass="gridview-header" Font-Bold="false" />
                    <AlternatingRowStyle CssClass="gridview-alternate-row" />
                    <RowStyle CssClass="gridview-row" HorizontalAlign="Center" />
            <Columns>
                <asp:BoundField DataField="sno" HeaderText="#" />
                <asp:BoundField DataField="ip" HeaderText="IP" />
                <asp:BoundField DataField="title" HeaderText="Title" />
            </Columns>
        </asp:GridView>


My .cs file
C#
protected void status(object sender, GridViewPageEventArgs e)
        {
            GridView gd = (sender as GridView);
            gd.PageIndex = e.NewPageIndex;
            gd.DataSource = MyMethod(parameter);
            gd.DataBind();
        }


Please help. Thanks in advance
Posted
Comments
JoCodes 21-Jan-14 0:00am    
Have you debugged it using mozilla? whats the behaviour when trying to paginate?
JoCodes 21-Jan-14 0:02am    
Is the OnPageIndexChanging event firing when debugging in mozilla? Also, give some information about whether you are placing gridview in update panel, using any validations etc.
srmohanr 21-Jan-14 1:03am    
Event is firing in IE, but not in Mozilla. And I didn't keep this gridview in update panel.

1 solution

i didn't found any error in your code.May be this problem occur from any other code so check properly..below code i used dataview which has datatable from session datatble and session datatble retrieve from database...

protected void status(object sender, GridViewPageEventArgs e)
    {
        GridView gd = (sender as GridView);
        dv = new DataView();
        gd.PageIndex = e.NewPageIndex;
       
        DataTable dt_sd = new DataTable();
        dt_sd =(DataTable)Session["details"];
        dv = dt_sd.DefaultView;       
        gd.DataSource = dv.ToTable(); //MyMethod(parameter);
        gd.DataBind();
    }
 
Share this answer
 
Comments
srmohanr 21-Jan-14 1:01am    
As I said this code is working in IE.
Sumit_Pathak 21-Jan-14 1:37am    
yes its working in all browsers.i checked it in mozila 26.0 version and its work perfectly...
srmohanr 22-Jan-14 1:30am    
I kept the Gridview in onother page, and calling the page inside an IFrame.
So when I do paging, javascript:_doPostBack('GridView1','Page$2') is not working.
I have checked that JS is enabled in my browser. Please help
Sumit_Pathak 22-Jan-14 2:11am    
do you use update panel in your page..???
srmohanr 22-Jan-14 2:24am    
I will explain you fully.
I have a FusionChart in my aspx page, and I have added drill-down for that FusionChart.
On clicking on chart, I calling another Page which has GridView, and I am passing values using query string. I kept that fusionchart under an update panel.

I am calling Javascript from chart
set value='100' label = '100' link='JavaScript:MyMethod(%26quot; 100 %26quot;);'

Literal1.Text = FusionCharts.RenderChartHTML("FusionChart/Pei3D", "", chart, chartID, width, height, false, false, true);

Below is my JavaScript method (MyMethod)
<pre lang="Javascript">
function MyMethod(var1) {
//window.alert(var1);
var modal = $find("newtest");
$("#dialog").empty();
$("#dialog").append("<iframe frameborder='0' sandbox='allow-top-navigation' target='_Parent' seamless='seamless' width='100%' height='100%' src='Default.aspx?status=" + var1 + "'></iframe>");
modal.show();
}
</pre>

Hope you understand this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900