Receber HTML pronto e injetar em projeto MVC
03/07/2013
0
Qualquer ajuda é bem-vinda.
Pjava
Posts
03/07/2013
Pjava
03/07/2013
Joel Rodrigues
03/07/2013
Pjava
03/07/2013
Joel Rodrigues
Comece pelas pastas das imagens e arquivos auxiliares.
03/07/2013
Joel Rodrigues
04/07/2013
Joel Rodrigues
Supondo que o designer me mandou o seguinte HTML:
<html> <head> <link rel="stylesheet" href="meu_estilo.css"/> </head> <body> <div id="cabecalho"> <h1>Título da página</h1> </div> <div id="menu"> <ul> <li>Menu 1</li> <li>Menu 2</li> <li>Menu 3</li> </ul> </div> <div id="conteudo"> </div> <div id="rodape"> <span>Mensagem</span> </div> </body> </html>
04/07/2013
Joel Rodrigues
Então esse arquivo deve ficar assim:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>@ViewBag.Title - My ASP.NET MVC Application</title> <link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" /> <meta name="viewport" content="width=device-width" /> @Styles.Render("~/Content/meu_estilo.css") </head> <body> <div id="cabecalho"> <h1>@ViewBag.Title</h1> </div> <div id="menu"> <ul> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Contact", "Contact", "Home")</li> </ul> </div> <div id="conteudo"> @RenderSection("featured", required: false); @RenderBody() </div> <div id="rodape"> <span>@DateTime.Today.Year</span> </div> </body> </html>
Repare que eu mantive alguns comandos começando com @, que são usados na renderização do conteúdo dinâmico.
As views serão então inseridas nessa página, onde consta o @RenderBody.
Sacou a ideia?
04/07/2013
Pjava
Clique aqui para fazer login e interagir na Comunidade :)