Yes it is in fact not hard to achieve this. You can use RemoteAttribute on the property of your model that you want to be validated asynchronously on the server, in your case it is id.
http://msdn.microsoft.com/en-us/library/system.web.mvc.remoteattribute(v=vs.118).aspx
// model
public class MyModel
{
[Remote("ValidateId", "MyController")]
public string Id { get; set; }
}
// controller
public class MyController
{
public ActionResult ValidateId(string id)
{
// action will be invoked when you change value in the browser.
// you have to return a string that contains an error if the id fails validation.
// or true if the id is valid.
// this is in case id is valid
// return Json(true, JsonRequestBehavior.AllowGet);
// this in case id is not vlaid.
// return Json("id is not valid", JsonRequestBehavior.AllowGet);
}
}
Take a look at this also:
http://msdn.microsoft.com/en-us/library/gg508808(v=vs.98).aspx