This is a discussion on How to do click operation on a button programmatically using JavaScript? within the HTML, CSS and Javascript Coding Techniques forums, part of the Web Development category; How to do click operation on a button programmatically using JavaScript...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Hi.. Please try this.. Using CodeBehind protected void Button1_Click(object sender, EventArgs e) { this.Label1.Text = "Button1 clicked!"; } protected void Button2_Click(object sender, EventArgs e) { somefunction(); } private void somefunction() { string sender = ""; EventArgs e = new EventArgs(); this.Button1_Click(sender, e); } Using JavaScript var mybutton = document.getElementById(yourButtonName); if (mybutton) { mybutton.click(); } |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to call a javascript function in a client side click? | leoraja8 | ASP and ASP.NET Programming | 4 | 10-30-2007 01:43 AM |
| I get a javascript error when I click on my calendar | Pvinothkumar | HTML, CSS and Javascript Coding Techniques | 1 | 09-13-2007 06:04 AM |
| I am having checkbox in datagrid and treeview, while click the button i need to check | kingmaker | C# Programming | 3 | 08-14-2007 09:39 AM |
| I keep getting "Data Missing" when I click the "back" button in my browser. How can I | oxygen | HTML, CSS and Javascript Coding Techniques | 1 | 07-28-2007 01:12 AM |
| Can I make a button on my page work as the browser's Back button in javascript? | kingmaker | HTML, CSS and Javascript Coding Techniques | 1 | 07-26-2007 01:27 AM |