문제

i have a about.html page in my application.

i want to give this page routing for that i use this code in global file

 RouteTable.Routes.MapPageRoute("AboutUs", "aboutus", "~/about.html");

but it gives me error like

There is no build provider registered for the extension '.html'. You can register one in the section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.

can anyone help me to give routing to this html page in asp.net not in mvc

thanks in advance

도움이 되었습니까?

해결책

Try to replace .html by .aspx:

routes.MapPageRoute("", "AboutUs/", "~/AboutUs.aspx");

This question can give you more details.

Update:

If you want to remove the extension check here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top