开发者

How to make an link execute a button onclick code?

开发者 https://www.devze.com 2023-03-29 15:15 出处:网络
How can I make a link (anchor) fire a button onclick code while the link is sitting in an Web User Control and the button is sitting in the main .aspx page.

How can I make a link (anchor) fire a button onclick code while the link is sitting in an Web User Control and the button is sitting in the main .aspx page.

What I'm trying to accomplish this is to be to export a gridview to excel from a too开发者_如何转开发lbar/utility bar that is sitting in the Web User Control.

Any help will really appreciate it.


<a href="#" onclick="document.getElementById('B').click();">hello</a>
<input type="button" id="B" onclick="alert('HA!');" />


Create a server side hyperlink and add Button1_click() to hyperlink click event.

0

精彩评论

暂无评论...
验证码 换一张
取 消