Add a hidden control and use Style = "display: none;" to hide it. Write the method in the Click Event of the control and call onclick of the Control Using JS.
The procedure is as follows:
Front-end:
Code
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> </title>
<SCRIPT type = "text/JavaScript">
Function Test (){
Document. getelementbyid ("button1"). Click ();
}
</SCRIPT>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Input type = "button" value = "test" onclick = "test ();"/> <br/>
<Asp: Button ID = "Button1" runat = "server" Text = "Button" onclick = "button#click"/>
</Div>
</Form>
</Body>
</Html>
Background:
Code
Using System;
Using System. Collections. Generic;
Using System. Web;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Public partial class _ Default: System. Web. UI. Page
{
Protected void Page_Load (object sender, EventArgs e)
{
}
Protected void button#click (object sender, EventArgs e)
{
Button1.Text = "";
}
}