سؤال

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