ASP.NET UpdatePanel 错误 htmlfile:未知的运行时错误,updatePanelElement.innerHTML=rendering

发布于 2024-07-11 22:14:15 字数 285 浏览 5 评论 0原文

在触发 UpdatePanel 后调试 ASP.NET Web 应用程序时,我收到此错误:

ASP.NET htmlfile: 未知运行时错误 updatePanelElement。 innerHTML=rendering

htmlfile:未知的运行时错误

,并且“updatePanelElement.innerHTML=rendering”在 ScriptResource.axd 文件中突出显示。

I get this error when debugging my ASP.NET web application after I trigger an UpdatePanel:

ASP.NET htmlfile: Unknown runtime error updatePanelElement.innerHTML=rendering

htmlfile: Unknown runtime error

and "updatePanelElement.innerHTML=rendering" is highlighted in a ScriptResource.axd file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

梦途 2024-07-18 22:14:15

我遇到了同样的问题。 就我而言,页面(表格)设计不正确。 以下是我的场景中的问题详细信息:

    <table>
<tr>
<td>
    <asp:Label id="Lb1" runat="server"/>
</td>
</tr>
<asp:UpdatePanel id="UP1" runat="server">
<ContentTemplate>
       <!-- controls in Update Panel-->
</ContentTemplate>
</asp:UpdatePanel>
<tr>
<td>
    <asp:Button id="btn" OnClick="btn_Click" runat="server"/>
</td>
</tr>
</table>

我已更改为

<table>
<tr>
<td>
    <asp:Label id="Lb1" runat="server"/>
</td>
</tr>
**<tr>
<td>**
<asp:UpdatePanel id="UP1" runat="server">
<ContentTemplate>
       <!-- controls in Update Panel-->
</ContentTemplate>
</asp:UpdatePanel>
**</td>
</tr>**
<tr>
<td>
    <asp:Button id="btn" OnClick="btn_Click" runat="server"/>
</td>
</tr>
</table>

“问题已解决”,将“更新”面板移动到另一个表行。
所以我坚信正确的屏幕设计应该解决此类问题。

I have encountered the same issue. In my case Page (Table) was not designed properly. Here is the issue details in my scenario:

    <table>
<tr>
<td>
    <asp:Label id="Lb1" runat="server"/>
</td>
</tr>
<asp:UpdatePanel id="UP1" runat="server">
<ContentTemplate>
       <!-- controls in Update Panel-->
</ContentTemplate>
</asp:UpdatePanel>
<tr>
<td>
    <asp:Button id="btn" OnClick="btn_Click" runat="server"/>
</td>
</tr>
</table>

I have changed to

<table>
<tr>
<td>
    <asp:Label id="Lb1" runat="server"/>
</td>
</tr>
**<tr>
<td>**
<asp:UpdatePanel id="UP1" runat="server">
<ContentTemplate>
       <!-- controls in Update Panel-->
</ContentTemplate>
</asp:UpdatePanel>
**</td>
</tr>**
<tr>
<td>
    <asp:Button id="btn" OnClick="btn_Click" runat="server"/>
</td>
</tr>
</table>

Issue resolved moving Update panel in to another table row.
So I strongly believe proper screen design should address this type of issues.

一向肩并 2024-07-18 22:14:15

感谢上面的解释 - 我找到了一个解决方案,通过用需要由事件更新的 li 包装 UpdatePanel 。 希望有帮助。

例如

<li>
<asp:UpdatePanel runat="server" ID="UpdatePanelCustInfo" UpdateMode="Conditional" RenderMode="Inline">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlCountry" />
    </Triggers>
    <ContentTemplate>
        <label>State:</label>
        <asp:DropDownList ID="ddlStateProvince" AutoPostBack="False" runat="server" CssClass="adminInput">
        </asp:DropDownList>
    </ContentTemplate>
</asp:UpdatePanel>
</li>

Thanks for the explanation above - I found a solution by wrapping the UpdatePanel with the li that needs to be updated by the event. Hope that helps.

e.g.

<li>
<asp:UpdatePanel runat="server" ID="UpdatePanelCustInfo" UpdateMode="Conditional" RenderMode="Inline">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="ddlCountry" />
    </Triggers>
    <ContentTemplate>
        <label>State:</label>
        <asp:DropDownList ID="ddlStateProvince" AutoPostBack="False" runat="server" CssClass="adminInput">
        </asp:DropDownList>
    </ContentTemplate>
</asp:UpdatePanel>
</li>
探春 2024-07-18 22:14:15

有同样的错误,错误地将更新面板放置在标签之间,而不是嵌套标签之间。 该修复完成了,所以我将其从:

<table>
<tr>
<asp:UpdatePanel runat="Server">
<ContentTemplate>
<td>

    //code here

</td>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</table>

改为:

<table>
<tr>
<td>
<asp:UpdatePanel runat="Server">
<ContentTemplate>

    //code here


</ContentTemplate>
</asp:UpdatePanel>
</td>

had the same error placed the update panel between the tags by mistake instead of the nested tags. That fix did it so i took it from this:

<table>
<tr>
<asp:UpdatePanel runat="Server">
<ContentTemplate>
<td>

    //code here

</td>
</ContentTemplate>
</asp:UpdatePanel>
</td>
</table>

to :

<table>
<tr>
<td>
<asp:UpdatePanel runat="Server">
<ContentTemplate>

    //code here


</ContentTemplate>
</asp:UpdatePanel>
</td>
波浪屿的海角声 2024-07-18 22:14:15

我遇到了同样的错误但已解决。

我在 UpdatePanel 中嵌套 html 表单。 只需删除 Form 标签即可解决问题。

I got the same error but solved.

I am nesting html form inside UpdatePanel. Simply removing the Form tag solved the issue.

许仙没带伞 2024-07-18 22:14:15

这似乎发生是因为我的 UpdatePanel 位于有序列表

    中 容器。 我有列表项

  1. ; 我的 UpdatePanel 的 ContentTemplate 中的标签。
<ol>
    <li>...</li>
    <asp:UpdatePanel ...>
        <ContentTemplate>
            <li id="lione" runat="server">...</li>
            <li id="litwo" runat="server">...</li>
        </ContentTemplate>
        <Triggers>
            ...
        </Triggers>
    </asp:UpdatePanel>
    <li>...</li>
</ol>

这对我来说很有意义,但我想我需要重新考虑我的页面布局。

This seems to happen because I've got my UpdatePanel within an ordered list <ol> container. And I've got list item <li> tags within my UpdatePanel's ContentTemplate.

<ol>
    <li>...</li>
    <asp:UpdatePanel ...>
        <ContentTemplate>
            <li id="lione" runat="server">...</li>
            <li id="litwo" runat="server">...</li>
        </ContentTemplate>
        <Triggers>
            ...
        </Triggers>
    </asp:UpdatePanel>
    <li>...</li>
</ol>

It makes sense to me this way, but I guess I'll need to rethink my page layout.

未蓝澄海的烟 2024-07-18 22:14:15

说这让我发疯是轻描淡写的。 我收到了 OP 描述的相同错误,并尝试使用我的 HTML 试图找出为什么我无法写入 ap 标记内的 div。 最后,我复制了我的页面 HTML,只是为了修改我页面上排列的 HTML,结果发现它与我正在摆弄的特定 UpdatePanel 无关。 我在页面底部的正文内容中有 javascript 脚本标记,我不知道到底为什么,但 IE8 讨厌这种安排。 我能够删除正文内容中的所有脚本,并将其放置在页面的 head 标签中,这个问题就消失了。 华泰

To say this drove me crazy is an understatement. I received the same error the OP described, and played around with my HTML trying to figure out why I couldn't write to a div within a p tag. In the end, I duplicated my page HTML just to screw around with the HTML arranged on my page, and found that it had nothing to do with the particular UpdatePanel I was fiddling with. I had javascript script tags in my body content at the bottom of my page, I don't know why exactly, but IE8 hated this arrangement. I was able to remove all script within my body content, and placed it in my head tag of my page, and this issue went away. HTH

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文