markdown
#說明
前面是在 index 新增 bootstrap 的套版,接下來也要幫 Rsvp 表單和 Thanks 的頁面增加 bootstrap 的樣式版
#操作流程
##修改RsvpForm.cshtml
```
@model Party1.Models.GuestResponse
@{
Layout = null;
}
RsvpForm
##Demo RsvpForm
##修改 Thanks ``` @{ Layout = null; }Thanks
@{
try
{
WebMail.SmtpServer = "smtp.example.com";
WebMail.SmtpPort = 587;
WebMail.EnableSsl = true;
WebMail.UserName = "mysmtpUsername";
WebMail.Password = "mysmtpPassword";
WebMail.From = "rsvps@example.com";
WebMail.Send("party-host@example.com", "RSVP Notification ",
Model.Name + "is" + ((Model.WillAttend ?? false )? "" : "not")
+ "attending") ;
}
catch (Exception){
@:Sorry-we couldn't send the email to confirm your RSVP.
}
}
```
##Demo Thanks
##其中中間有加入 webmail 但還未完整
RSVP
@using (Html.BeginForm())
{
@Html.ValidationSummary()
```
@Html.TextBoxFor(x => x.Name, new { @class = "form-control" })
@Html.TextBoxFor(x => x.Email, new { @class = "form-control" })
@Html.TextBoxFor(x => x.Phone, new { @class = "form-control" })
@Html.DropDownListFor(x => x.WillAttend, new[]{
new SelectListItem(){Text="Yes,I'll be there",Value=bool.TrueString},
new SelectListItem(){Text="No,I can't come.",Value=bool.FalseString}},
"Choose an option", new { @class = "form-control" })
}
##Demo RsvpForm
##修改 Thanks ``` @{ Layout = null; }
Thandk you ,@Model.Name!
@if (Model.WillAttend == true)
{
@:It's great that you're coming. The drinks are already in the fridge!
}
else
{
@:Sorry to hear that you can't make it, but thanks for letting us know.
}
##Demo Thanks
##其中中間有加入 webmail 但還未完整
留言
張貼留言