Fórum Receber HTML pronto e injetar em projeto MVC #447711
03/07/2013
0
Qualquer ajuda é bem-vinda.
Pjava
Curtir tópico
+ 0Posts
03/07/2013
Pjava
Gostei + 0
03/07/2013
Joel Rodrigues
Gostei + 0
03/07/2013
Pjava
Gostei + 0
03/07/2013
Joel Rodrigues
Comece pelas pastas das imagens e arquivos auxiliares.
Gostei + 0
03/07/2013
Joel Rodrigues
Gostei + 0
03/07/2013
Pjava
Gostei + 0
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>Gostei + 0
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?
Gostei + 0
04/07/2013
Pjava
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)