HI,
I want to call my function written in C# in JavaScript on any event [ Click / change ]
public void DisplayHello()
{
Response.Write("<script>alert('Hello')</script>");
}
I want to call above function in JavaScript.
You cannot call Server side functions in JavaScript. You can only call WebMethods using AJAX
Calling server side function from JavaScript in ASP.Net
Calling server side methods using JavaScript and JQuery in ASP.Net
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.