Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. public class BillingModel
  2. {
  3. [Required,
  4. DisplayName("First Name")]
  5. public string FirstName { get; set; }
  6.  
  7. [Required,
  8. DisplayName("Last Name")]
  9. public string LastName { get; set; }
  10. }
  11.  
  12. public class CustomerModel
  13. {
  14. [Required,
  15. DisplayName("Address")]
  16. public string Adress { get; set; }
  17.  
  18. [Required,
  19. DisplayName("City")]
  20. public string City { get; set; }
  21. }
  22.  
  23. public class OrderViewModel
  24. {
  25. public BillingModel Billing { get; set; }
  26. public CustomerModel Customer { get; set; }
  27. }
  28.  
  29. <input id="Business_FirstName" name="Business.FirstName" type="text" value="" />
  30.  
  31. <input id="Business_LastName" name="Business.LastName" type="text" value="" />
  32.  
  33. @Html.TextBoxFor(x => x.Business.FirstName)
  34. @Html.TextBoxFor(x => x.Business.LastName)
  35.  
  36. <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
  37. <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
  38.  
  39. @Html.TextBoxFor(x => x.Business.FirstName)
  40. @Html.ValidationMessageFor(x => x.Business.FirstName)
  41.  
  42. @Html.TextBoxFor(x => x.Business.LastName)
  43. @Html.ValidationMessageFor(x => x.Business.LastName)
  44.  
  45. <add key="ClientValidationEnabled" value="true" />
  46. <add key="UnobtrusiveJavaScriptEnabled" value="true" />
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement