Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. public class CustomValidators
  2. {
  3. [Required]
  4. [Required(ErrorMessage = "State Required")]
  5. public string drpStateId { set; get; }
  6.  
  7. public System.Web.Mvc.SelectList drpState { set; get; }
  8. [Required(ErrorMessage ="Region Required")]
  9. public string txtRegion { set; get; }
  10. }
  11.  
  12. @model InterviewTest.Models.CustomValidators
  13.  
  14. @{
  15. ViewBag.Title = "Custom Validator";
  16. Layout = "~/Views/_Layout.cshtml";
  17. }
  18.  
  19. <p>@Html.ActionLink("< Back", "Index")</p>
  20.  
  21. @using (Html.BeginForm("CustomValidatorPost"))
  22. {
  23. @Html.ValidationSummary()
  24. <div class="container-fluid">
  25. <div class="row">
  26. <div class="col-sm-3">
  27. <div class="form-group">
  28. @Html.DropDownListFor(c => c.drpStateId, Model.drpState, "", new { @class = "form-control" })
  29. </div>
  30. </div>
  31.  
  32. <div class="col-sm-6">
  33. <div class="form-group">
  34. @Html.TextBoxFor(x => Model.txtRegion, new { @class = "form-control" })
  35. @*<input type="text" id="txtRegion" name="txtRegion" class="form-control" />*@
  36. </div>
  37. </div>
  38.  
  39. <div class="col-sm-3">
  40. <button type="submit" name="btnSubmit" id="btnSubmit" class="btn btn-default">Submit</button>
  41. </div>
  42. </div>
  43. </div>
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement