Jquery doesnt work inside AJAX updatepanel..http://forums.asp.net/t/1773637.aspx/1?Jquery+doesnt+work+inside+AJAX+updatepanel+Tue, 28 Feb 2012 07:58:11 -050017736374850235http://forums.asp.net/p/1773637/4850235.aspx/1?Jquery+doesnt+work+inside+AJAX+updatepanel+Jquery doesnt work inside AJAX updatepanel.. <p>Hi,</p> <p>My jquery doesnt work inside AJAX update panel..<br> HELP....</p> <p>Here's some code snippet..</p> <pre class="prettyprint">&lt;asp:UpdatePanel runat=&quot;server&quot; id=&quot;UpdatePanel&quot; updatemode=&quot;Conditional&quot;&gt; &lt;Triggers&gt; &lt;asp:AsyncPostBackTrigger controlid=&quot;lnkNotifs&quot; eventname=&quot;Click&quot; /&gt; &lt;asp:AsyncPostBackTrigger controlid=&quot;lnkMessages&quot; eventname=&quot;Click&quot; /&gt; &lt;asp:AsyncPostBackTrigger controlid=&quot;lnkThreads&quot; eventname=&quot;Click&quot; /&gt; &lt;/Triggers&gt; &lt;ContentTemplate&gt; &lt;asp:LinkButton ID=&quot;lnkNotifs&quot; runat=&quot;server&quot; CssClass=&quot;sbi-entertainment&quot; style=&quot;font-size: 1.0em; color: white&quot; onclick=&quot;ShowNewNotifs_Click&quot;&gt;&lt;span class=&quot;point&quot;&gt;&lt;/span&gt;&lt;em&gt;27&lt;/em&gt; Notifications&lt;/asp:LinkButton&gt; &lt;asp:LinkButton ID=&quot;lnkMessages&quot; runat=&quot;server&quot; CssClass=&quot;sbi-entertainment&quot; style=&quot;font-size: 1.0em; color: white&quot; onclick=&quot;ShowNewMessages_Click&quot;&gt;&lt;span class=&quot;point&quot;&gt;&lt;/span&gt;&lt;em&gt;27&lt;/em&gt; Messages&lt;/asp:LinkButton&gt; &lt;asp:LinkButton ID=&quot;lnkThreads&quot; runat=&quot;server&quot; CssClass=&quot;sbi-entertainment&quot; style=&quot;font-size: 1.0em; color: white&quot; onclick=&quot;ShowNewThreadsPost_Click&quot;&gt;&lt;span class=&quot;point&quot;&gt;&lt;/span&gt;&lt;em&gt;27&lt;/em&gt; Threads/Posts&lt;/asp:LinkButton&gt; &lt;br /&gt; &lt;div style=&quot;padding-top: 5px&quot;&gt; &lt;asp:ListView ID=&quot;lstMSG&quot; runat=&quot;server&quot;&gt; &lt;LayoutTemplate&gt; &lt;table style=&quot;border-top: 1px solid gray;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;4&quot; rules=&quot;all&quot;&gt; &lt;tbody&gt; &lt;asp:PlaceHolder ID=&quot;itemPlaceHolder&quot; runat=&quot;server&quot; /&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/LayoutTemplate&gt; &lt;ItemTemplate&gt; &lt;tr style=&quot;border-bottom-color: Gray; border-bottom-width: 1px; border-bottom-style: solid;&quot;&gt; &lt;td style=&quot;padding: 4px&quot;&gt; &lt;img style=&quot;vertical-align: top&quot; alt=&quot;picImages&quot; src=&quot;Upload/&lt;%#Eval(&quot;strAvatar&quot;) %&gt;&quot; width=&quot;70px&quot; /&gt; &lt;/td&gt; &lt;td style=&quot;padding: 4px; width: 192px&quot;&gt; &lt;div style=&quot;font-weight: bold; color: white&quot;&gt; &lt;%#Eval(&quot;strFromUserName&quot;)%&gt; &lt;/div&gt; <strong> &lt;asp:LinkButton id=&quot;lnkShowUserMessageModal&quot; class=&quot;overshow&quot;&gt; </strong> &lt;div style=&quot;font-weight: normal; color: gray&quot;&gt; &lt;%#Eval(&quot;strMessage&quot;)%&gt; &lt;/div&gt; &lt;/asp:LinkButton&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/ItemTemplate&gt; &lt;EmptyDataTemplate&gt; &lt;div&gt; No Message... &lt;/div&gt; &lt;/EmptyDataTemplate&gt; &lt;/asp:ListView&gt; &lt;br /&gt; &lt;asp:Label ID=&quot;Label4&quot; runat=&quot;server&quot; Font-Size=&quot;Small&quot; Font-Bold=&quot;true&quot; ForeColor=&quot;white&quot; Width=&quot;280px&quot; Style=&quot;text-align: center&quot;&gt;See All Messages&lt;/asp:Label&gt;&lt;br /&gt; &lt;/div&gt; &lt;/ContentTemplate&gt; &lt;/asp:UpdatePanel&gt;</pre> <p>&nbsp;</p> <p>The underline part "&lt;asp:Linkbutton id="lnkShowUserMessageModal" class="overshow"&gt;" is calling a Jquery...</p> <pre class="prettyprint">&lt;script type="text/javascript"&gt; &#36;(document).ready(function () { &#36;("#lnkShowUserMessageModal").click(function (e) { ShowDialog_UserMessage(true); e.preventDefault(); }); ......................................</pre> <p><br> <br> I WANT TO ACHIEVE.. clicking the link button will show a jquery overlay.... and so on...</p> 2012-02-25T03:36:09-05:004850320http://forums.asp.net/p/1773637/4850320.aspx/1?Re+Jquery+doesnt+work+inside+AJAX+updatepanel+Re: Jquery doesnt work inside AJAX updatepanel.. <p></p> <blockquote><span class="icon-blockquote"></span> <h4>Kurai</h4> &lt;asp:Linkbutton id=&quot;lnkShowUserMessageModal&quot; class=&quot;overshow&quot;&gt;</blockquote> <p></p> <p>I'm not sure why it is not having runat=&quot;server&quot; attribute. if it has then check for generated ID and make sure you've the same ID in your Jquery code. I also suggest you to check out <a target="_blank" href="http://forums.asp.net/t/1666291.aspx/1?Jquery&#43;with&#43;update&#43;panels"> this</a> thread.</p> 2012-02-25T05:37:13-05:004854312http://forums.asp.net/p/1773637/4854312.aspx/1?Re+Jquery+doesnt+work+inside+AJAX+updatepanel+Re: Jquery doesnt work inside AJAX updatepanel.. <p>Hi,</p> <p>Try this-</p> <pre class="prettyprint">$(document).ready(function () { $(&quot;a[id*=lnkShowUserMessageModal]&quot;).live(&quot;click&quot;, function (e) { ShowDialog_UserMessage(true); e.preventDefault(); });</pre> 2012-02-28T07:58:11-05:00