Last post Oct 28, 2009 09:13 PM by Mohamed_Meligy
Feb 10, 2009 05:29 PM|Tweek82|LINK
Can someone explain to me why controls in an ajax-updatepanel don't work when I use jQuery to popup this updatepanel? If I use AJAX modalpopup-extender instead of the jQuery one, it works. With jQuery popup, no calls to the code-behind are made at all.
The jQuery Modal Popup I use:
Thanks in advance
jQuery ajax updatepanel
Feb 10, 2009 05:42 PM|Evan Freeman|LINK
Have any code to show us? Hard to just guess. Also some details as to it just doesn't work may be helpfull. How does it not work? It doesn't come up? Or it comes up but the update panel isn't being triggered? How are you adding it to the page (i.e. show
Feb 10, 2009 05:52 PM|Tweek82|LINK
Hi, here is my code:
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<a id="linky" href="#">click to open popup</a>
<asp:Panel runat="server" ID="modaly" Style="width: 500px; height: 500px;">
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
<asp:Label runat="server" ID="lbldatetime"></asp:Label><br />
<asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="click" />
<asp:Button runat="server" ID="btnUpdate" OnClick="btnUpdate_click" Text="Bla" />
And in the aspx.cs file:
protected void Page_Load(object sender, EventArgs e)
protected void btnUpdate_click(object sender, EventArgs e)
lbldatetime.Text = DateTime.Now.ToString();
Feb 10, 2009 06:21 PM|Evan Freeman|LINK
Can you answer the other questions as well please.
Feb 10, 2009 06:30 PM|Tweek82|LINK
Offcourse, sorry for that: If i click the anchor tag (<a>), the jquery-modal pop's up. But when i click the button, the code behind onclick event, doesn't get triggered. I just figured out that also without the update panel, the button does not trigger the
Feb 10, 2009 07:08 PM|Evan Freeman|LINK
Ok that answers alot, so knowing all that I took a look at the source js for that plugin. If I miss my guess the problem is that that button and that panel and teh like are not wired up properly because he is cloning the elements basically making new ones,
so question, I know another one =]
I assume that you have this updatepanel and the like in the page, and you point this at it via JS and popup the modal, does the one in the page work? Probably would.
So next step use the IE Developer toolbar or, firebug depends on your browser to lookk at the markup of that popup and see how it compares to one that works, my guess the ids and names will be different.
Feb 10, 2009 09:30 PM|FrenchiInLA|LINK
return false; <--------------------------------------------------------
Feb 11, 2009 02:22 AM|chetan.sarode|LINK
Actually, we don't suggest you use other AJAX frameworks and ASP.Net Ajax on the same site or on the same page.
So, in this scenario, I would like to suggest you try to read the following articles which talk about ASP.NET and JQuery working together:
jQuery effects not working after UpdatePanel Asynchronous request is over
Integrating jQuery with ASP.NET
3 mistakes to avoid when using jQuery with ASP.NET AJAX
Feb 12, 2009 07:15 AM|Tweek82|LINK
Thank you all very much for your reply's! I'm taken this knowledge with me to redesign my webpage.
Oct 28, 2009 09:13 PM|Mohamed_Meligy|LINK
Did you try to use pageLoad instead of jQuery ready?
pageLoad is called when ASP.NET AJAX decides the page is ready, and after every UpdatePanel update.