Advertisement
Guest User

Untitled

a guest
Apr 2nd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.36 KB | None | 0 0
  1. <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Setup.Mvc.ViewModels.SignUpViewModel>" %>
  2.  
  3. <asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
  4. SignUp
  5. </asp:Content>
  6. <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
  7. <% using (Html.BeginForm("SignUp", "SetUp", FormMethod.Post))
  8. {
  9.  
  10. %>
  11. <%: Html.ValidationSummary()%>
  12. <button type="submit" value="Register" name="ActionRegister" >Register</button>
  13. <button type="submit" value="Cancel" name="ActionCancel" class="cancel" >Cancel</button>
  14. <fieldset>
  15. <legend>Account Information </legend>
  16. <dl>
  17. <dt>
  18. <%:Html.LabelFor(x=>x.UserName)%>
  19. </dt>
  20. <dd>
  21. <%: Html.TextBoxFor(x=>x.UserName) %>
  22. <%: Html.ValidationMessageFor(model => model.UserName) %>
  23. </dd>
  24. <% if (string.IsNullOrEmpty(Model.Provider))
  25. {
  26. %>
  27. <dt>
  28. <%:Html.LabelFor(x=>x.Password)%>
  29. </dt>
  30. <dd>
  31. <%: Html.PasswordFor(x => x.Password)%>
  32. <%: Html.ValidationMessageFor(model => model.Password) %>
  33. </dd>
  34. <%
  35. } %>
  36. <dt>
  37. <%:Html.LabelFor(x=>x.Email)%>
  38. </dt>
  39. <dd>
  40. <%: Html.TextBoxFor(x=>x.Email) %>
  41. <%: Html.ValidationMessageFor(model => model.Email) %>
  42. </dd>
  43. <dt>
  44. <%:Html.LabelFor(x=>x.Themes) %>
  45. </dt>
  46. <dd>
  47. <%: Html.DropDownList("ThemeId", Model.Themes.Select(x=> new SelectListItem{ Text = x.DisplayName, Value = x.DisplayName}), "Select a Theme") %>
  48. <%: Html.ValidationMessageFor(model => model.Themes) %>
  49. </dd>
  50. </dl>
  51. </fieldset>
  52. <fieldset>
  53. <legend>
  54. <h2>
  55. Additional Information</h2>
  56. </legend>
  57. <dl>
  58. <dt>
  59. <%:Html.LabelFor(x=>x.PublicSite)%>
  60. </dt>
  61. <dd>
  62. <%:Html.CheckBoxFor(x => x.PublicSite)%>
  63. <%: Html.ValidationMessageFor(model => model.PublicSite) %>
  64. </dd>
  65. <dt>
  66. <%:Html.LabelFor(x=>x.SiteUrl)%>
  67. </dt>
  68. <dd>
  69. http://cheesyurl.com/<%:Html.TextBoxFor(x => x.SiteUrl)%>
  70. <%: Html.ValidationMessageFor(model => model.SiteUrl) %>
  71. </dd>
  72. </dl>
  73. </fieldset>
  74. <%
  75. }%>
  76. </asp:Content>
  77.  
  78. [HttpPost]
  79. [ActionName("SignUp")]
  80. [UnitOfWork]
  81. [AcceptParameter(Action = "ActionRegister")]
  82. public ActionResult SignUp_Register(SignUpViewModel vm)
  83. {
  84. return View();
  85. }
  86.  
  87. Parametersapplication/x-www-form-urlencoded
  88. Email wayne@isit.gd
  89. Password sdfsdfsdfsdf
  90. PublicSite false
  91. SiteUrl sdfsdfsdf
  92. ThemeId
  93. UserName Usernames-12131
  94. Source
  95. Content-Type: application/x-www-form-urlencoded Content-Length: 112 UserName=Usernames-Sux0r&Password=sdfsdfsdfsdf&Email=wayne%40isit.gd&ThemeId=&PublicSite=false&SiteUrl=sdfsdfsdf
  96.  
  97. <input type="submit" name="Delete" value="Delete" />
  98. <input type="submit" name="Edit" value="Delete" />
  99.  
  100. <input type="submit" value="Register" name="ActionRegister"/>
  101. <input type="submit" value="Cancel" name="ActionCancel" class="cancel" />
  102.  
  103. <% using (Html.BeginForm("SignUp", "SetUp", FormMethod.Post))
  104. {%>
  105. <%: Html.ValidationSummary()%>
  106. <input type="submit" value="Register" name="actionName" />
  107. <input type="submit" value="Cancel" name="actionName" class="cancel">Cancel</input>
  108. }
  109.  
  110. public ActionResult SignUp_Register(SignUpViewModel vm,string actionName)
  111. {
  112. if(actionName =="Register")
  113. //Do something;
  114. if(actionName =="Cancel")
  115. //Do something;
  116.  
  117. return View();
  118. }
  119.  
  120. <button type="submit" value="Register" name="ActionRegister" >Register</button>
  121. <button type="submit" value="Cancel" name="ActionCancel" class="cancel" >Cancel</button>
  122.  
  123. <button type="submit" id="btnRegister" name="btn" class="btn btn-primary" value="Register">
  124. Register
  125. </button>
  126. <button type="submit" id="btnCancel" name="btn" class="btn btn-primary" value="Cancel">
  127. Cancel
  128. </button>
  129.  
  130. [HttpPost]
  131. public ActionResult SignUp_Register(string btn, SignUpViewModel vm m)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement