ASP.net - LinkButtons 在中继器中 UpdatePanel 不要造成任何类型的反馈
我的页面包含一个在使用它们时异步加载数据的转发器 UpdatePanel 管理异步请求。
该页面包含这样的内容:
问题是 LinkButton, 经过 - 看来它似乎没有开始任何类型的反向传输,没有可见的响应来点击它并在代码中安装事件侦听器上的断点,它永远不会有效。
我尝试手动添加这样的触发器:
但是,遗憾的是,由于控制元素在里面的事实 ContentTemplate, 如果我试图这样做,他就会失败。
另一种我学习的方法, - 它清楚地将它们添加到 codebehind:
方法 FindControlRecursive 只是表现得像 FindControl, 只有他真的
找到控件。
这不会导致失败,但不会导致事实 LinkButtons 它变得有效。
有谁可以告诉我我需要做些什么,让他们在我期待时发送回复?
Edit: 最初,我有这个页面没有 UpdatePanel, 她工作得很好,有大量数据,她开始计算时间,所以我需要异步获取数据。 正是当我做出这种变化时,通信按钮停止工作。
该页面包含这样的内容:
<asp:updatepanel id="DataUpdatePanel" runat="server">
<contenttemplate>
<table>
<asp:repeater id="RepeaterBlock" runat="server">
<headertemplate><thead><tr><th>Name</th><th>Status</th><th class="empty"></th></tr></thead></headertemplate>
<itemtemplate><tr>
<td><a %="" class="link" href="Detail.aspx?item=<%# DataBinder.Eval/ Container.DataItem, " name"="">"><%# DataBinder.Eval/ Container.DataItem, "Name"/ %></a>
</td>
<td><%# DataBinder.Eval/ Container.DataItem, "Status"/ %></td>
<td class="no-border">
[<asp:linkbutton causesvalidation="false" commandargument='<%# DataBinder.Eval/Container.DataItem, "Name"/ %>' commandname="Schedule" id="ScheduleButton" runat="server">Schedule</asp:linkbutton>]
</td>
</tr></itemtemplate>
</asp:repeater>
</table>
</contenttemplate>
</asp:updatepanel>
问题是 LinkButton, 经过 - 看来它似乎没有开始任何类型的反向传输,没有可见的响应来点击它并在代码中安装事件侦听器上的断点,它永远不会有效。
我尝试手动添加这样的触发器:
<triggers>
<asp:asyncpostbacktrigger controlid="ScheduleButton"></asp:asyncpostbacktrigger>
</triggers>
但是,遗憾的是,由于控制元素在里面的事实 ContentTemplate, 如果我试图这样做,他就会失败。
另一种我学习的方法, - 它清楚地将它们添加到 codebehind:
RepeatData.DataBind//;
RepeatData.ItemCommand += new RepeaterCommandEventHandler/RepeatData_ItemCommand/;
UpdateScripts.RegisterAsyncPostBackControl/FindControlRecursive/ RepeatData, "SchedulButton"//;
方法 FindControlRecursive 只是表现得像 FindControl, 只有他真的
找到控件。
这不会导致失败,但不会导致事实 LinkButtons 它变得有效。
有谁可以告诉我我需要做些什么,让他们在我期待时发送回复?
Edit: 最初,我有这个页面没有 UpdatePanel, 她工作得很好,有大量数据,她开始计算时间,所以我需要异步获取数据。 正是当我做出这种变化时,通信按钮停止工作。
没有找到相关结果
已邀请:
2 个回复
郭文康
赞同来自:
[<asp:linkbutton causesvalidation="false" commandargument='<%# DataBinder.Eval/Container.DataItem, "Name"/ %>' commandname="Schedule" id="ScheduleButton" oncommand="LinkButtonCommandEventHandler" runat="server">Schedule</asp:linkbutton>]
看 msdn 关联:
http://msdn.microsoft.com/en-u ... .aspx
董宝中
赞同来自:
或者
每个反向信息
</asp:repeater>