开发者

Html Template into Asp.net2.0

I have an html template having html pages , images and css. Now I want to convert or make it asp pages with code开发者_运维百科 behinds. what is the solution? Thanks


Create a new Web application project. Delete the default.aspx page that is created for you. Add a master page. Then add a new content form based on the master page. This form (.aspx page) will have the code-behind already created for you automagically :)

Create an images folder and css folder; add a new stylesheet to the css folder.


you can create a master page from scratch and then copy your HTML Markup inserting inside the Divs, or tables you want the children pages to fill in the tag.

this is the easier way given the master page will contain all other ASPXs and whenever you write a thing it will be displayed inside the selected area.

for instance

you got

<html>
<body>
   <yourHTML markup>
</body>
</html>

You can adapt and write

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

<!DOCTYPE html >
<html>
<head runat="server">
    <title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
    <link href="../../Content/Site.css" rel="stylesheet" type="text/css" />
</head>
<body>    
    <asp:ContentPlaceHolder ID="MainContent" runat="server" />
</body>
</html>

Thats it, ASP.NET are text files after all.

after the master page is done, every single ASPX you create will inherit and thus use the main style.

Edit: better Master Page Example


You need to create ASPX pages (and perhaps Master pages) that contain your HTML.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜