@model Wen.BooksStore.Domain.Entities.Cart <div > ÄãµÄ¹ºÎï³µ£º@Model.ComputeTotalValue() <span>@Html.ActionLink(, , , new { retunUrl = Request.Url.PathAndQuery }, null)</span> </div>
¡¡¡¡¶ÔÓ¦µÄ²¼¾ÖÒ³ _Layout.cshtml Ð޸ĵĵط½Îª£º
<!DOCTYPE html> <html> <head> <meta name=content=/> <title>@ViewBag.Title</title> <link href=rel=/> </head> <body> <div id=> @{ Html.RenderAction(, );} <div >ͼÊéÉ̳Ç</div> </div> <div id=> @{ Html.RenderAction(, ); } </div> <div id=> @RenderBody() </div> </body> </html>
_Layout.cshtml
¡¡¡¡Ìí¼ÓÁËеĶ«Î÷£¬css Ò²Òª½øÐÐÐ޸ģº
body { } #header, #content, #sideBar { display: block; } #header { background-color: green; border-bottom: 2px solid #111; color: White; } #header, .title { font-size: 1.5em; padding: .5em; } #sideBar { float: left; width: 8em; padding: .3em; } #content { border-left: 2px solid gray; margin-left: 10em; padding: 1em; } .pager { text-align: right; padding: .5em ; margin-top: 1em; } .pager A { font-size: 1.1em; color: #666; padding: 0 .4em 0 .4em; } .pager A:hover { background-color: Silver; } .pager A.selected { background-color: #353535; color: White; } .item input { float: right; color: White; background-color: green; } .table { width: 100%; padding: 0; margin: 0; } .table th { font: bold 12px , Verdana, Arial, Helvetica, sans-serif; color: #4f6b72; border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; border-top: 1px solid #C1DAD7; letter-spacing: 2px; text-transform: uppercase; text-align: left; padding: 6px 6px 6px 12px; background: #CAE8EA no-repeat; } .table td { border-right: 1px solid #C1DAD7; border-bottom: 1px solid #C1DAD7; background: #fff; font-size: 14px; padding: 6px 6px 6px 12px; color: #4f6b72; } .table td.alt { background: #F5FAFA; color: #797268; } .table th.spec, td.spec { border-left: 1px solid #C1DAD7; } .bookSummary { width: 15%; float: right; margin-top: 1.5%; }
Site.css¶þ¡¢¶©µ¥½áËã
¡¡¡¡¹ºÎïÍê±Ï¾ÍÊǽáËãÒ³ÃæÁË£¬ÕâÀïµÄ¶©µ¥½áËã²¢²»Éæ¼°Ö§¸¶½Ó¿ÚµÄµ÷Óã¬Ö»ÊÇʹÓÃÓʼþµÄÐÎʽ½øÐÐ֪ͨ¶øÒÑ¡£
¡¡¡¡ÕâÀÎÒÉè¼Æ½áËãµÄʱºòÐèÒªÒªÇóÓû§ÊäÈëһЩÐÅÏ¢£¬ÈçÐÕÃû¡¢µØÖ·ºÍÓÊÏäµÈÐÅÏ¢£¬ÔÚµã»÷È·¶¨Ê±ÎÒÔÙ½«ÕâЩÊäÈëµÄÐÅÏ¢Ó빺ÎïÇåµ¥µÄÐÅÏ¢´ÓϵͳµÄÓÊÏä·¢µ½ÄãËùÊäÈëµÄÓÊÏäµ±ÖС£Ò»¸ö±È½ÏÖ±¹ÛµÄͼ£º
¡¡¡¡
¡¡¡¡1.ÔÚ Entities ÖÐÌí¼ÓÒ»¸öÓòÄ£ÐÍ Contact.cs ±íʾÁªÏµÈ˵ÄÐÅÏ¢¡£
ÁªÏµÐÅÏ¢ Contact { [Required(ErrorMessage = )] public string Name { get; set; } [Required(ErrorMessage = )] public string Address { get; set; } [Required(ErrorMessage = )] [RegularExpression(, ErrorMessage = )] public string Email { get; set; } }
¡¡¡¡CartController.cs Ìí¼ÓÒ»¸öÓÃÓÚ½áËãµÄ Action:
½áËã ViewResult Checkout() { return View(new Contact()); }
¡¡¡¡Checkout.cshtml Öеģº
¡¡