0

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

Hardik Mer
  • 824
  • 4
  • 14
  • 26

1 Answers1

1

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

Community
  • 1
  • 1
glautrou
  • 3,140
  • 2
  • 29
  • 34
  • but i don't want to convert that page with .aspx , i want to use it as .html page only – Hardik Mer Aug 04 '13 at 16:52
  • Check at my update, you can just remove the extension of your files in IIS instead of adding a new route for each single page. – glautrou Aug 04 '13 at 16:55