Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys im just wondering if you could help me. I am trying to access a control (image button) inside an EditFormTemplate. I wast to display a popup when the user presses this button. No matter what I try I cant seem to get it to find the control. The code works fine when I try access a different control on the form so I know it's not the javascript. Here's my code.
JavaScript
$(document).ready(function() {

        $('#btnUpdate').click(function(e) {       // Button which will activate our modal
           $('#modal').reveal({               // The item which will be opened with reveal
               animation: 'fade',             // fade, fadeAndPop, none
               animationspeed: 200,           // how fast animtions are
               closeonbackgroundclick: true,  // if you click background will modal close?
               dismissmodalclass: 'close'     // the class of a button or element that will close an open modal
           });
           return false;
       });
   });


And my aspx page
<pre lang="HTML">
<asp:ImageButton ID="btnUpdate" ImageUrl="~/Images/GridItemUpdate.gif" runat="server" CommandName="Update" ToolTip="Save Record">
                                                                </asp:ImageButton>

If anyone can help i'd be truly greatful, thanks guys
Posted

1 solution

Why do you have this enclosed in

$(document).ready()


remove it an your click should work
 
Share this answer
 
Comments
frostcox 29-Nov-12 11:53am    
Hey I got it working by enclosing the ('modal').reveal insind a seperate method and calling it onClientClick, but I have another problem, The CommandName="Update" is getting fired before I have time to read the result from the modal. thanks
[no name] 29-Nov-12 11:59am    
Call the command manually and wait on the event validation

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900