问题
I have a gridview within an updatepanel which allows paging and has a linkbutton that when clicked shows a modalpopup for editing records. This works fine in IE, Firefox, and Opera but I do not get a postback in Chrome or Safari?? I have other linkbuttons on the page that are within updatepanels but are not within gridviews that are working fine. I have scowered the web but cannot find a solution. Part of my code is below, anyone have any ideas??
#
<asp:UpdatePanel ID="upReports" runat="server" UpdateMode="Conditional">
# <ContentTemplate>
# <asp:HiddenField ID="hfMachID" runat="server" />
# <asp:HiddenField ID="hfNewLead" runat="server" Value="no" />
# <div class="fullWidth">
# <div class="heading">
# <h2 style="padding:10px">
# <asp:Label ID="lblResults" runat="server" />
# </h2>
# </div>
#
# <!-- Machine Leads -->
# <asp:GridView ID="gvMachLeads" runat="server" Visible="false" AutoGenerateColumns="false"
# GridLines="None" CssClass="mGrid" AlternatingRowStyle-CssClass="alt" AllowPaging="true"
# OnPageIndexChanging="gvMachLeads_PageIndexChanging" PagerStyle-CssClass="pgr"
# onrowcommand="gvMachLeads_RowCommand" PageSize="15">
# <Columns>
# <asp:TemplateField HeaderText="Created" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:Label ID="lblDate" runat="server" Text='<%# Eval("DateC") %>'
# CssClass="repGridText" ToolTip='<%# "Origin: " + Eval("LeadOrigin") %>' />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Status" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:Label ID="lblStatus" runat="server" Text='<%# Eval("LeadStatus") %>'
# CssClass="repGridText" ToolTip='<%# "Notes: " + Eval("Comments") %>' />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Customer" ItemStyle-HorizontalAlign="Left">
# <ItemTemplate>
# <asp:Label ID="lblCustomer" runat="server" Text='<%# Eval("Name") %>'
# CssClass="repGridText" ToolTip='<%# "Address: " + Eval("Add1") + " - " + Eval("City") +
# " - " + Eval("State") + " - " + Eval("Zip") %>' />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Phone" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:Label ID="lblPhone" runat="server" Text='<%# Eval("Phone") %>'
# ToolTip='<%# "Contact: " + Eval("FirstName") + " " + Eval("LastName") %>'
# CssClass="repGridText" />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Email" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:HyperLink ID="hlEmail" runat="server" Text='<%# Eval("Email") %>'
# CssClass="repGridLbtn" NavigateUrl='<%#"mailto:" + Eval("Email") %>' />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="ESM" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:Label ID="lblRsm" runat="server" Text='<%# Eval("EsmTerritory") %>'
# ToolTip='<%# "Agent: " + Eval("AgentName") + ", Salesperson: " + Eval("SalesPerson") %>'
# CssClass="repGridText" />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Machine" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:LinkButton ID="lbtnMach" runat="server" Text='<%# Eval("MachModel") %>'
# CssClass="repGridLbtn" CommandName="GetMachInfo"
# ToolTip='<%# "Factory: " + Eval("Producer") %>'
# CommandArgument=<%# Eval("MachID") + "§" + Eval("Name") + "<br />" + Eval("MachModel") %> />
# </ItemTemplate>
# </asp:TemplateField>
# <asp:TemplateField HeaderText="Est. Sales" ItemStyle-HorizontalAlign="Center">
# <ItemTemplate>
# <asp:Label ID="lblEstSales" runat="server" Text='<%#string.Format("{0:C}", Eval("EstSales"))%>'
# ToolTip='<%# "Invoice Probability: " + Eval("InvProb") + "%, Chance: " +
# Eval("Chance") + "%" %>' CssClass="repGridText" />
# </ItemTemplate>
# </asp:TemplateField>
# </Columns>
# </asp:GridView>
# </div>
# </ContentTemplate>
# </asp:UpdatePanel>
回答1:
Follow the link below. http://blog.lavablast.com/post/2008/10/Gotcha-WebKit-%28Safari-3-and-Google-Chrome%29-Bug-with-ASPNET-AJAX.aspx
回答2:
If grid view is working fine (I mean visible properly) on IE, Firefox, and Opera, but not in Google chrome, then do the necessary changes into your code:
add visible="false"
in your <asp:UpdateProgress>
tag.
来源:https://stackoverflow.com/questions/2457551/gridview-paging-controls-not-working-in-google-chrome-or-safari