0

working for find a solution to my question I have found another doubt which I can't find solution, that's why I'm here asking for the knowledge of experts. I have an image button inside a Repetear like this:

<asp:ImageButton class ="approvalDialog" runat="server" OnClick = "test_rr" CommandArgument = '<%# Eval("aux_approvalId")%>'/>

My problem is that the class approvalDialog is opening a jQuery dialog, and if it is opened, the event is not fired, if I delete class ="approvalDialog", the event is firing.

So my question is: If is possible open the dialog and in the same time fire the event? Thanks!

Community
  • 1
  • 1
Jorge
  • 1,178
  • 2
  • 13
  • 33

2 Answers2

1

use the onclientclick = "javascriptfunction();"

if it is not working at the same time take a look at this post stack post

also you could also make a webmethod that the jquery/javascript function could call using an ajax call.

Community
  • 1
  • 1
HELP_ME
  • 2,619
  • 3
  • 24
  • 31
  • Hi bugz, I tried onclientclick but is not working, also what I could adjust from the post to my app but not lucky. I have to search more information about the webmethod and test it, but if you know some example please let me know.Thanks for your reply. – Jorge Dec 05 '12 at 17:28
  • can you post what you tried? also did the onclientclick cause the function to fire, is the function in the same aspx page or in a seperate js file? – HELP_ME Dec 05 '12 at 17:35
  • Sure, here there is: function OpenapprovalDialog(){ $.blockUI({ message: $('#approval-form'), baseZ: 10000 }); $('#approval-form').parent().appendTo($("form:first")); return false;}; I have tried with onclientclick = "return OpenapprovalDialog()" and other ways, also addind the property UseSubmitBehavior="false". The js file is in the same page. – Jorge Dec 06 '12 at 09:15
0

Yes, this is working like this:

<td class ="approval-img"><asp:ImageButton runat="server" CommandArgument = '<%# Eval("aux_approvalId")%>'  OnClick="getApprovalID_approve" OnClientClick="OpenApprovalDialog()" ToolTip="Approve" ImageUrl="/Images/Approve.png" /></td>

My problem, I saw that with the console of firebug, was that the javascript function I was calling wasn't defined, and that was because I hade declared it inside the $(document).ready(function ()

Jorge
  • 1,178
  • 2
  • 13
  • 33