我试图让联系表单中的文本框对齐。但我不确定该怎么做。我没有任何运气而与css搞砸了。我也一直试图让这个表格发送到电子邮件..没有运气。任何帮助表示赞赏!
Contact.cshtml代码:
<legend>Registration Form</legend>
<ol>
<li>
@Html.LabelFor(m => m.Reason)
@Html.TextBoxFor(m => m.Reason)
</li>
<li>
@Html.LabelFor(m => m.FirstName)
@Html.TextBoxFor(m => m.FirstName, new { placeholder = "John " })
</li>
<li>
@Html.LabelFor(m => m.LastName)
@Html.TextBoxFor(m => m.LastName, new { placeholder = "Doe" })
</li>
<li>
@Html.LabelFor(m => m.Username)
@Html.TextBoxFor(m => m.Username, new {placeholder = "JohnDoe01" })
...............
<input type="submit" value="Send" />
</fieldset>
联系模式:
public class ContactModel
{
[Required]
[Display(Name = "Reason for contact")]
public string Reason { get; set; }
[Required]
[Display(Name = "First Name")]
public string FirstName { get; set; }
[Required]
[Display(Name = "Last Name")]
public string LastName { get; set; }
[Required]
[Display(Name = "User Name")]
public string Username { get; set; ...........}