How To Understand dynamic HTML in Visual Studio 2008?

送分小仙女□ 提交于 2019-12-11 01:37:44

问题


I'm trying to update a VB.NET Web Project done by someone else about 5 years ago using Visual Studio 2008.

The webform I am stumped on now has two (2) ASP GridView controls, and I can't seem to tell how an ImageButton is evaluating (or failing).

I need to fix the failing part!

Below is a GridView control with the ImageButton ibComplete that is failing:

<asp:GridView ID="GridView1" Font-Size="Small" AllowPaging="true" PageSize="25" OnRowCommand="gridview1_RowCommand" OnSelectedIndexChanged="gridview1_SelectedIndexChanged" OnRowDataBound="gridview1_RowDataBound" runat="server" Visible="False" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="950px" BackColor="White" DataKeyNames="partid,primary_vendor,PART_DESCRIPTION,PRI_VENDOR_NAME,MIN_REORD_QTY,PUOM,Revised_Date">
  <Columns>
    <asp:TemplateField HeaderText="">
      <ItemStyle Width="30px" />
    <ItemTemplate>
      <asp:ImageButton ID="ibComplete" CommandName="Complete" Width="17px" Height="15px" ImageUrl="~/Images/uncheck.jpg" runat="server" CommandArgument="<%# CType(Container,GridViewRow).RowIndex %>" />
    </ItemTemplate>
    <HeaderTemplate>
      <asp:LinkButton ID="lbaddAll" CommandName="AddAll" runat="server">All</asp:LinkButton>
    </HeaderTemplate>
  ...

OK, for the ImageButton ibComplete, I have set a breakpoint on the RowCommand:

Protected Sub gridview1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs)
  Try
    Dim GridView1 As GridView = CType(gvVendor.SelectedRow.FindControl("GridView1"), GridView)
    m_emp = m_master.Employee ' EmployeeManager.getEmployeeListByEmpLogin(empName.Trim)
    If e.CommandName = "Complete" Then

However, before it is ever hit, I have some odd looking "eval code" file that is throwing an error here:

_endPostBack: function PageRequestManager$_endPostBack(error, executor, data) {
    if (this._request === executor.get_webRequest()) {
        this._processingRequest = false;
        this._additionalInput = null;
        this._request = null;
    }

    var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
    Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
    if (error && !eventArgs.get_errorHandled()) {
        throw error;
    }
},

The error, reported through the VS2008 GUI, is simply this:

JavaScript runtime error:
Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.

This code doesn't even exist in my document, and on the tab for it in VS2008, it is called ScriptResource.a...cf8d3f2 [dynamic]. It vanishes as soon as I stop my project, so I can't really edit any of it.

I realize this is very hard for most to understand, and that I'll likely need to include something else for someone to be able to answer me. That's fine! Just tell me what I need to include.

How do I fix this error?


回答1:


This is likely an issue with a change made in IE 10 that sends the coordinates of Image inputs in decimal format instead of as integers.

Some suggested fixes include:

  1. Upgrading to the .Net 4.5 Framework
  2. Setting compatibility mode to IE8/9

    meta http-equiv="X-UA-Compatible" content="IE=8"

  3. Applying these patches:

.Net 4.0

http://support.microsoft.com/kb/2836939

.Net 2.0

http://support.microsoft.com/kb/2836943

http://support.microsoft.com/kb/2836942

The Bug Report URL is https://connect.microsoft.com/VisualStudio/feedback/details/755419/asp-net-4-0-and-ie10-click-on-imagebutton-in-updatepanel-produces-error-click-on-normal-button-does-not



来源:https://stackoverflow.com/questions/17451143/how-to-understand-dynamic-html-in-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!