If you want to validate on server-side you should use, for example, asp.net web-service.
If you want to create it just add .asmx file in your solution.
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]
public class WebService : System.Web.Services.WebService
{
[WebMethod]
public bool ValidateDate(string value)
{
bool isValide =true;
//Validation code
return isValide
}
}
After creating web-service you can send request to it, using $.ajax
for example, like this (I like to use JSON):
where webserviceName is name of your .asmx file
and function is name of web-service method you need.
$.ajax(
{
type: "POST",
url: webserviceName + functionName,
contentType: "application/x-www-form-urlencoded; windows-1251;",
dataType: json,
data: parameters,
success: callbackFunction,
error: errorCallbackFunction
});
See example on this page - http://msdn.microsoft.com/en-us/library/bb515101.aspx