如何转换硬codeD HTML网站对ASP mvc4?
我有5页硬codeD HTML网站,并希望将其转换为mvc4。
I have a hard coded html website of 5 pages and want to convert it to mvc4.
我需要做什么?
有一步引导教程或步骤概述如何使html的动态文件通过MVC?
what do i need to do? Is there a tutorial or step by step guide outlining how to make .html files dynamic via MVC?
您会想你改变过来之前得到MVC的一个基本的了解,尤其是路由 - 你会避免很多混乱和陷阱中未来。
You are going to want to get a basic understanding of MVC and especially the routing before you change it over - you will avoid a lot of confusion and pitfalls in the future.
基本上,所有你需要做的是为您的HTML控制器(假人,现在),和HTML复制到相应的视图。这将当你明白在Global.asax文件中的路由是行得通的。然后,我会更新的链接 @ Html.ActionLink
语法,并从那里转移 - 接下来可能提取 _layout
通用设计等。
Basically, all you will need to do is create Controllers (dummy, for now) for your html, and copy the html into the respective View. This will all make sense when you understand the routing in the global.asax file. Then I would update the links to @Html.ActionLink
syntax and move from there - likely next extracting a _Layout
for universal design, etc.
基本上,读取最小的快速教程,或者你只会阻碍自己。
Basically, read a quick tutorial at minimum, or you will just frustrate yourself.