简体   繁体   中英

Modalpopup not working properly asp.net ajax

I have an updatepanel,a modal popup extender inside that and an image button to open the pop up(it has not any click event). The 'div' for the modal pop up is outside the updatepanel. In the modal pop up the records come in a table with a link in each table row.When the link is clicked,a javascript function causes a hidden control to postback and fetch values from database.First time it is working fine,but next time the image button(TargetControlID for modal pop up extender) does not work and it is causing a postback and loading the page.Help plz... Thanks in advance. Mohak

Are you using myLink.ClientID or did you hardcoded the ID of the link in the Javascript function?

The ID of the link is probably changed when doing the first postback, the second time ASP.NET has generated a new ID (not visible in the HTML because of the AJAX-request) for your link and this doesn't match anymore with the ID in your Javascript function.

The solution would be to use myLink.ClientID

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