471,887 Members | 1,435 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,887 software developers and data experts.

Run click event of image button

121 100+
i m new to javascript and i think what i am trying to do cant be accomplished w/o it.
i am using ajax modelpopupextender and using OnOkscript="OnOk()" .
now in OnOk(), i m trying to run a click event of some button(image button)

coding is

ajax control
Expand|Select|Wrap|Line Numbers
  1. <cc1:ModalPopupExtender ID="ErrorPopup" runat="server" PopupControlID="PopupPanel" BackgroundCssClass="backclass" TargetControlID="CancelButton" OkControlID="OkButton" OnOkScript="onOk()"
  2.                   CancelControlID="CancelPopButton"></cc1:ModalPopupExtender>
Expand|Select|Wrap|Line Numbers
  1.  <script language="javascript" type="text/javascript">
  2.     function onOk()
  3.     {     
  4.         document.getElementById("<%= CancelButton %>").OnClick();  
  6.     }
and the button it is trying to run
Expand|Select|Wrap|Line Numbers
  1. <asp:ImageButton ID="CancelButton" runat="server" skinid="buttonCancel" OnClick="CancelButton_Click" CssClass="button" />
error i am getting is cancelbutton NUll

i have tried it with1) replacing cancelButton text with something like ct100blah..... 2) Onclick with Click

nothing seems to work

any help..
Oct 23 '08 #1
1 3263
16,027 Expert Mod 8TB
Show the client-side versions of your code. You can use the click() method (note the lower-case).
Oct 24 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

reply views Thread by sakieboy | last post: by
3 posts views Thread by TCORDON | last post: by
1 post views Thread by Andy Rose | last post: by
reply views Thread by Oddball | last post: by
1 post views Thread by TarDuk a memory beyond the life | last post: by
3 posts views Thread by Andreas Wöckl | last post: by
2 posts views Thread by chrisp | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.