@using Newtonsoft.Json; @functions { public class CaptchaResponse { [JsonProperty("success")] public bool Success { get; set; } [JsonProperty("error-codes")] public List ErrorCodes { get; set; } } } @{ var captchaValidationMessage = ""; Validation.RequireField("fullName", "Full Name has to be filled"); Validation.RequireField("cellNo", "Cellphone Number has to be filled"); Validation.RequireField("medicalCondition", "Medical Condition has to be filled"); if (IsPost) { string fullName = ""; string cellNo = ""; string landlineNumber = ""; string emailAddress = ""; string genderType = ""; string visitorType = ""; string medicalCondition = ""; string emailBody = ""; fullName = Request.Form["fullName"]; cellNo = Request.Form["cellNo"]; landlineNumber = Request.Form["landlineNumber"]; emailAddress = Request.Form["emailAddress"]; genderType = Request.Form["genderType"]; visitorType = Request.Form["visitorType"]; medicalCondition = Request.Form["medicalCondition"]; var captcha = Request["g-recaptcha-response"]; emailBody = fullName + "
" + cellNo + "
" + landlineNumber + "
" + emailAddress + "
" + genderType + "
" + visitorType + "
" + medicalCondition; //@captcha if (captcha.Equals(String.Empty)) { //Response.Write("Captcha is null."); captchaValidationMessage = "To prove you are human, please check the box above."; } else { //Response.Write("Captcha is NOT null."); captchaValidationMessage = ""; if (Validation.IsValid()) { /* @fullName
@cellNo
@landlineNumber
@emailAddress
@genderType
@visitorType
@medicalCondition
@captcha
*/ try { var dt = DateTime.Now; if (IsPost) { WebMail.Send( to: "drpbanerjitelemed@yahoo.co.in", subject: "Patient Enquiry: " + dt.ToLongTimeString(), body: emailBody ); captchaValidationMessage = "Mail sent."; } } catch(Exception ex) { } } else { } } } } Contact Dr. Parimal Banerji Medical Research Centre

Patient Enquiry Form

Please try to fill in all the below mentioned fields to help you better. Mandatory fields are Full Name, Mobile Number, Gender, Medical Condition.

@Html.ValidationMessage("fullName")

@Html.ValidationMessage("cellNo")









@Html.ValidationMessage("medicalCondition")


@Html.Raw(captchaValidationMessage)