.NET 4.0中的网格视图问题,但它在.NET 4.5中运行良好

时间:2014-06-13 20:08:02

标签: asp.net c#-4.0 gridview asp.net-4.0 asp.net-4.5

我将应用程序从3.5迁移到4.5。所有功能在.NET 4.5上运行良好。但由于我的生产服务器是Windows 2003 R2 Server,我不得不将我的.NET降级到4.0。

当我在gridview中选择一行时,出现以下错误。

例外:

Input string was not in a correct format.
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Convert.ToInt32(String value, IFormatProvider provider)
at System.Web.UI.WebControls.GridView.HandleEvent(EventArgs e, Boolean causesValidation, String validationGroup)
at System.Web.UI.WebControls.GridView.RaisePostBackEvent(String eventArgument)
at System.Web.UI.WebControls.GridView.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

GridView的:

<asp:GridView 
        runat="server"
        ID="Gridview1"
        AutoGenerateColumns="false" CssClass="Grid"
        OnRowCommand="Gridview1_RowCommand"
        OnRowDataBound="Gridview1_RowBound"
        CellPadding="4"
        GridLines="None"
        AllowPaging="True"
        OnPageIndexChanging="Gridview1_PageIndexChanging"
        PageSize="10"
        EmptyDataText="Search returned (0) records.">

    <FooterStyle CssClass="GridFooter" />
    <RowStyle CssClass="GridRow" />
    <EditRowStyle CssClass="GridEditRow" />
    <SelectedRowStyle CssClass="GridSelectedRow" />
    <PagerStyle CssClass="GridPager" />
    <HeaderStyle CssClass="GridHeader" />
    <AlternatingRowStyle CssClass="GridAlternateRow" />
    <Columns>
        <asp:TemplateField HeaderText="Select" Visible="false">
            <ItemTemplate>
                <asp:CheckBox runat="server" ID="ChkBox" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>

HOT FIXES:KB2600088-x86.exe,KB2836939-v3-x86.exe。我尝试了两个热门修复程序,但没有一个修复了我的问题。

如果有人可以帮助我,那就太好了。

0 个答案:

没有答案