Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery and Master Page makes an error when use button click function
    primarykey
    data
    text
    <p>I have one modal popup extender on my ASP.NET form. But I have 3 different buttons that need to run same Modal. So I'm trying to use jQuery to solve this problam. I have created a button (will be hidden in the future), and the ajax modal point to that button. Now when I'm pressing each button (of the other three), It calls javascript function that sends click() function to the button that points to the modal. The problam is that the modal works for only one moment and dissapeer, while it suppost to stay static. (When I press the "hidden button" it works well).</p> <p>** I placed <code>ClientIDMode="Static"</code> on Master Page so the ID is working fine..<br /> Here is my code: </p> <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"&gt; &lt;script type="text/ecmascript"&gt; function pressMe() { $('#hide_button').click(); } &lt;/script&gt; </code></pre> <p></p> <p>My ASP.NET code:</p> <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server"&gt; &lt;asp:Button ID="Button_bodyPart" runat="server" Text="add/edit" OnClientClick="pressMe();" /&gt; &lt;asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" BehaviorID="modalPopupExtender1" TargetControlID="hide_button" PopupControlID="popUpPanel" OkControlID="btnOk" BackgroundCssClass="modalBackground"&gt; &lt;/asp:ModalPopupExtender&gt; &lt;asp:Button ID="hide_button" runat="server" Text="Button" /&gt; &lt;asp:Panel ID="popUpPanel" runat="server" CssClass="modalPopup"&gt; &lt;h1&gt; bla bla bla&lt;/h1&gt; &lt;asp:Button ID="btnOk" runat="server" Text="Ok" /&gt; &lt;/asp:Panel&gt; </code></pre> <p></p> <p>Thanks a-lot.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload