hi all,
I am developing a web application. I have written one function in .aspx file. Now i want to call that function from the .aspx.cs file. How can I do this? Can anybody help me regarding this?
thanks in advance
You can call that function using Page.ClientScript method
something like:
Page.ClientScript.RegisterStartupScript(this.GetType(), "Test", "YourFunctionName();",true);
Or you can also attach a JavaScript event to a Server Control like:
Button1.Attributes.Add("onclick", "YourFunctionName();");
Or the other easy option would be
Response.write("<script>YourFunctionName(); <\script>")