public class ContactController : SurfaceController
{
[HttpPost]
public JsonResult SendMail(Contact model)
{
if (ModelState.IsValid)
{
var sb = new StringBuilder();
sb.AppendFormat("<p>Name:{0}</p>", model.YourName);
sb.AppendFormat("<p>Email:{0}</p>", model.Email);
sb.AppendFormat("<p>Message:{0}</p>", model.Message);
library.SendMail(model.Email, "[email protected]", model.Subject, sb.ToString(), true);
return Json(true);
}
return Json(false);
}
}
I have this surface controller and it is doing exactly what I want BUT my problem is two fold:
All of a sudden when I click submit on my form it will not post to the controller instead the browser is throwing a JS error > Uncaught ReferenceError: Sys is not defined
2.How can I process the result of the controller, as you can see I am trying to use JSON but all that happens (when it was working and posting to the controller) the browser just shows the string True/False instead of running the js functions.
Processing the result for a Surface Controller
I have this surface controller and it is doing exactly what I want BUT my problem is two fold:
This is the form
Uncaught ReferenceError: Sys is not defined
2.How can I process the result of the controller, as you can see I am trying to use JSON but all that happens (when it was working and posting to the controller) the browser just shows the string True/False instead of running the js functions.
Any Ideas?
is working on a reply...