Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi All,

 

What I am trying to do is probably ridiculously easy but I need your help.

 

For example I am trying to call the click event of button called Button1. Here is my attempt (line 6 being the line of importance):

1    <html xmlns="http://www.w3.org/1999/xhtml" >
2    <head runat="server">
3        <title>Ajax</title>
4    </head>
5    <body>
6        <script type="text/javascript">Button1.click();</script>
7        <noscript>alert("Disabled");</noscript>
8        <form id="form1" runat="server">
9        <div>
10           <asp:Button ID="Button1" runat="server" Text="Button"/></div>
11       </form>
12   </body>
13   </html>
14   

 

This doesn't seem to work, can you help.

 

Cheers, Dave.

Posted
that doesnt look correct. You need the onClick event of the Button, name it for example, myButtonOnClick. Then have a function called myButtonOnClick and do whatever you need to do there.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...