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

posted on 2005-08-22 18:11  cy163  阅读(4966)  评论(1编辑  收藏  举报

导航