I'm building a MVC3 application, with certain web forms (.aspx) files in the project.
Now I just got the design files and am integrating the UI design (html, css, etc.) into my logic.
Somehow when I run the app (F5), it always goes to the "root/Default.aspx"; I really want to set "root/Index.html" as the "Start Page", by default; but I cannot find anywhere defines it.
I went thru the web.config and the Global.asax files - there is no mention of "Default.aspx" in any settings; so why does it goes there?
Please let me know how to set index.html as the start page; or if this is possible?
To set the startup page in MVC application, you need to go to properties page of the application and set Specific Page in Start Action section of Web tab.
The format need to be ControllerName/ActionName/parameters id any
Re 1) you are right - the app was running and I did not notice that. So I went to the properties page for this project, under Web, set the start page to be "index.html" under the root dir; and saved it.
However, when I run the app afterwards, it still goes to the old default page, i.e. "Default.aspx".
Even when I "exclude the default.aspx from the project", then run it, it still tried to load Default.aspx, and could not find it.
I also treid in SOlution Exploror, right click index.html, "Set as Start Page", but it does not work either.
claudia888
Member
182 Points
437 Posts
Can I set index.html as the start page by default for a MVC application?
Nov 17, 2012 07:38 PM|LINK
HI,
I'm building a MVC3 application, with certain web forms (.aspx) files in the project.
Now I just got the design files and am integrating the UI design (html, css, etc.) into my logic.
Somehow when I run the app (F5), it always goes to the "root/Default.aspx"; I really want to set "root/Index.html" as the "Start Page", by default; but I cannot find anywhere defines it.
I went thru the web.config and the Global.asax files - there is no mention of "Default.aspx" in any settings; so why does it goes there?
Please let me know how to set index.html as the start page; or if this is possible?
Thanks,
CLaudia
Bimalvv
Contributor
2356 Points
478 Posts
Re: Can I set index.html as the start page by default for a MVC application?
Nov 18, 2012 02:29 AM|LINK
Hi,
To set the startup page in MVC application, you need to go to properties page of the application and set Specific Page in Start Action section of Web tab.
The format need to be ControllerName/ActionName/parameters id any
For eg: Account/LogOn/
Thanks,
Bimal
Bimal
claudia888
Member
182 Points
437 Posts
Re: Can I set index.html as the start page by default for a MVC application?
Nov 18, 2012 04:20 AM|LINK
Thanks for the feedback.
1) I tried to edit the properties page of the app, but eveything is greyed out there, so I cannot edit it;
2) Is it possible to set the "root/index.html" as the default page ?
Thanks,
Claudia
Bimalvv
Contributor
2356 Points
478 Posts
Re: Can I set index.html as the start page by default for a MVC application?
Nov 18, 2012 03:28 PM|LINK
Hi,
Might be you are running the application. Make sure that it is stoped and yoy can see various radiobuttons like Current Page, Specific Page etc.
Yes, if thr root is outside 'Views' folder
Thanks,
Bimal
Bimal
claudia888
Member
182 Points
437 Posts
Re: Can I set index.html as the start page by default for a MVC application?
Nov 19, 2012 01:00 AM|LINK
Hi Bimal,
Thanks for the reply.
Re 1) you are right - the app was running and I did not notice that. So I went to the properties page for this project, under Web, set the start page to be "index.html" under the root dir; and saved it.
However, when I run the app afterwards, it still goes to the old default page, i.e. "Default.aspx".
Even when I "exclude the default.aspx from the project", then run it, it still tried to load Default.aspx, and could not find it.
I also treid in SOlution Exploror, right click index.html, "Set as Start Page", but it does not work either.
Any more suggestions?