input type="button" onClick="this.disabled=true;document.getElementById(btnSend) .click();value="Go!...

How to call a javascript function from a HTML button on a user control
http://www.issociate.de/board/post/245473/How_to_call_a_javascript_function_from_a_HTML_button_on_a_user_control.html


I have a user control called "Test1" with two button on it ,one is input and
the other one is a server control as follow:

<input type="button"
onClick="this.disabled=true;document.getElementById(btnSend) .click();value="Go!">
<asp:button id="btnSend" runat="server" onClick="click" Width="90px"
Text="HiddenControl" Visible="False"></asp:button>

As you can see the asp.net button is calling a java script function as
follows:

<script language="c#" runat="server">
void click(object sender, EventArgs e)
{
//do something
}
</script>

when I run this code I get a java script error that "btnSend" is undefined
which generated from the first line (HTML button).I don;t know how to call
click even of server control from the html control.Dose anyone know how to
tackle this problem?

Thanks a lot
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值