css - 关闭兼容性 View IE11 时链接按钮未触发的问题

标签 css asp.net linkbutton asprepeater

我在不知情的情况下构建了一个在 IE 上激活兼容性 View 的 .net Web 应用程序。停用兼容性 View 不仅会使一切看起来一团糟,还会削减未触发事件的 LinkBut​​ton 的功能。

我正在通过按顺序填充转发器来构建日历。数据来自 SQL。

<asp:Repeater runat="server" id="RepeaterCalendar">
<ItemTemplate>

<asp:label ID="Month_lbl" runat="server" Text='<%# Bind("Month") %>'/>
<asp:label ID="Pretag_lbl" runat="server" Text='<%# Bind("PRETAG") %>'/>
<asp:LinkButton ID="ButtonSelect" runat="server" CommandName ="Select" CommandArgument = '<%# Eval("date") %>' Text='<%# Bind("TAG") %>'  style="vertical-align:text-bottom" OnClick="GetDetails" Visible="true"  /> 
<asp:label ID="Posttag_lbl" runat="server" Text='<%# Bind("POSTTAG") %>'/>
<asp:label ID="Monthend_lbl" runat="server" Text='<%# Bind("MonthEnd") %>'/>

</ItemTemplate>
</asp:Repeater>

关闭兼容性 View 后,LinkBut​​ton 不会触发该事件,而当再次打开兼容性 View 时它可以正常工作。


我想这与我使用 asp:repeater 粘合在一起形成日历表的所有断裂代码位有关。如果我绑定(bind)一个没有任何 html 标签的“普通”列,那么 LinkBut​​ton 将按预期工作;但这破坏了整个日历设计。

马丁

最佳答案

<asp:Repeater runat="server" id="RepeaterCalendar">
<ItemTemplate>

<asp:label ID="Month_lbl" runat="server" Text='<%# Bind("Month") %>'/>
<asp:label ID="Pretag_lbl" runat="server" Text='<%# Bind("PRETAG") %>'/>
<asp:LinkButton ID="ButtonSelect" runat="server" CommandName ="Select"
                CausesValidation="false" CommandArgument = '<%# Eval("date") %>' Text='<%# Bind("TAG") %>'  style="vertical-align:text-bottom" OnClick="GetDetails" Visible="true"  /> 
<asp:label ID="Posttag_lbl" runat="server" Text='<%# Bind("POSTTAG") %>'/>
<asp:label ID="Monthend_lbl" runat="server" Text='<%# Bind("MonthEnd") %>'/>

</ItemTemplate>
</asp:Repeater>

使用 CausesValidation="false"

关于css - 关闭兼容性 View IE11 时链接按钮未触发的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41569266/

相关文章:

html - 正文仅在页面的中间位置移动,导致我的页脚显示在页面的中间位置

javascript - 通过 AJAX 请求发送 ® 字符时出现问题

css - 我的阴影过滤器语法不正确吗?

asp.net - asp.net 捆绑如何在内部工作

asp.net - 将参数传递给中继器内的用户控件

ASP.NET 动态添加的 LinkBut​​ton - OnClick 处理程序未被调用

jquery - 触发asp.net链接按钮点击回车键

c# - 将数据保存在文本框中,就像按 BACKSPACE 一样

html - 为什么 Z-index 在这里不起作用?

css - 使用另一个文件中的变量时,.less 文件无法编译