简体   繁体   中英

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. Inside this modal I have some runat="server" controls, including a 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.

The link outside the Repeater works correctly. 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.

  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.

Any ideas?

If I understand you correctly, are you say that LinkButton in Repeater cause full post-back? are you try to set ClientIDMode="AutoID" for repeater? What do you mean "but does not fire the event as expected"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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