469,580 Members | 1,953 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,580 developers. It's quick & easy.

Run click event of image button

121 100+
hello,
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>
ONOK()
Expand|Select|Wrap|Line Numbers
  1.  <script language="javascript" type="text/javascript">
  2.     function onOk()
  3.     {     
  4.         document.getElementById("<%= CancelButton %>").OnClick();  
  5.  
  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 3143
acoder
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 suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.