1

As mentioned in the comment, you can easily do it with jquery ajax. For this you will have to define a WebMethod something like this:-
Please include using System.Web.Services;.
[WebMethod]
public static bool Check_exam_id(string className, string MethodName)
{
bool examIdExist = false;
...