简体   繁体   中英

how to load routes dynamically from database in asp.net webforms

I want to load routes on every requests, i have tried to put it this code RegisterBundles(RouteTable.Bundles) to the Application_Beginrequest .

seems this method helped me but also now when i refresh the page i am getting an errors on browser.

  • WebResource.axd (net::ERR_ABORTED 500)
  • ScriptResource.axd (net::ERR_ABORTED 500)
  • /bundles/all?v=klnl4k (Refused to apply style from ".." because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.)

How can i load routes dynamically from database without an error?

As i say i was thinking about the routing problem. Problem is when routing loads dynamically than it seems same route is loading again and it makes problem for scriptresources and bundling.

I put routes.Clear(); before load the routes and my problem is disappeared.

I hope this information will help you to understand your problem and you can solve this error just like that.

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM