简体   繁体   English

模式中的中继器中的LinkBut​​ton回发

[英]LinkButton Postback In Repeater In Modal

The code is a little big to post here, but hopefully someone can give me some ideas on what to look for. 该代码在此处发布时有点大,但是希望有人可以给我一些有关查找内容的想法。

I've got an ASP.NET Webforms page, containing a Bootstrap Modal dialog box. 我有一个ASP.NET Webforms页面,其中包含一个Bootstrap Modal对话框。 Inside this modal I have some runat="server" controls, including a Repeater . 在此模式内,我有一些runat="server"控件,包括Repeater I have 2 LinkButton controls, one inside the Repeater and one outside, both of which are bound to the same server-side event handler. 我有2个LinkButton控件,其中一个在Repeater内部,一个在外部,这两个都绑定到相同的服务器端事件处理程序。

The link outside the Repeater works correctly. Repeater外部的链接正常工作。 The one inside still posts-back, but does not fire the event as expected. 内部的那个仍然回发,但没有按预期触发事件。

Some things I noticed: 我注意到了一些事情:

  1. My first thought was that the modal was being removed from the ASP.NET form (as some are prone to do), but if this was true, none of the controls inside would work. 我首先想到的是,该模态已从ASP.NET表单中删除(有些人很容易这样做),但是如果这是真的,则其中的任何控件都不起作用。

  2. I tried this using regular Buttons, and it worked correctly. 我使用常规的按钮尝试了此操作,并且可以正常工作。 That means it's something to do with the __doPostBack Javascript that LinkButtons use. 这意味着它与LinkBut​​tons使用的__doPostBack Javascript有关。

Any ideas? 有任何想法吗?

If I understand you correctly, are you say that LinkButton in Repeater cause full post-back? 如果我对您的理解正确,是不是说Repeater中的LinkBut​​ton会导致完全回发? are you try to set ClientIDMode="AutoID" for repeater? 您是否尝试为中继器设置ClientIDMode =“ AutoID”? What do you mean "but does not fire the event as expected" 您的意思是“但未按预期触发事件”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM