想要使用HTML页面作为ASP.NET MVC中的起始页面 [英] Want to use HTML page as start page in ASP.NET MVC
问题描述
您好
我在MVC中创建一个html页面作为主页面布局。单击Project Set Specific页面并将index.html页面.HTML页面工作在本地计算机上,但是当我将它上传到服务器上时,它没有自行工作
输入完整URL后,页面工作
我的问题是
我想创建一个简单的html页面并首先调用,这里面临着如何在Href标签上调用layout + sign的问题
我尝试过:
创建一个没有MVC布局的静态页面
Hello
am create a html page as a Home Page Layout in MVC. After Click on Project Set Specific page and Give index.html page .HTML page work on local machine but when i upload it on server that no working its self
When is enter full URL then Page Work
My Problem is
I want to create a simple html page and call in on first and here am facing issue how to call layout + sign in view on Href tag
What I have tried:
Create a static page without MVC layout
推荐答案
您好:
默认控制器为主页,默认操作为索引,因此当您使用http://yoursite.com自动打开应用程序时,使用控制器主页,并且索引,就好像您将使用http:// yoursite.com/Home/Index。
因此,如果您想在这种情况下显示index.htm页面,可以在 Home 控制器中使用此代码。 br />
Hello:
The default controller is Home and the default action is Index, so when you open the application with http://yoursite.com automatically is used the controller Home and the tion is Index, as if you will be used http://yoursite.com/Home/Index.
So if you want to show a "index.htm" page in this case you can use this code in the Home controller.
<br />
public ActionResult Index()<br />
{<br />
return RedirectPermanent("~/index.htm");<br />
}<br />
我希望这能帮到你
I hope this will help you
这篇关于想要使用HTML页面作为ASP.NET MVC中的起始页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!