Click to See Complete Forum and Search --> : Call code behind method from javascript


nkaushik
September 1st, 2004, 08:18 AM
Hi,
I have a method in codebehind which I will have to call when particular situation occurs. How I can call method of code behind that is in c# from javascript or any other way to achieve the functionality.

MRutledge
September 1st, 2004, 07:11 PM
I am not totally sure what you are looking for but take a look at my example to see if this is what you are trying to do:


<asp:Button id="Button1" runat="server" Text="Button" onClick="Button1_Click"></asp:Button>

<input id="btn" name="btn" value="Call Server" type="button" onclick="document.getElementById('Button1').click()"/>