0

I need to use Url Routing for ASP.NET WebForms just like the micrsoft web Site does. You type in microft.com and it redirects to microsoft/en-us/default.aspx

My application contains a lot of pages so that I need to add one routing for all pages. And also I need to write a default culture in the url if the customer does not write one.

MyWebsite/contact.aspx?lang=en => MyWebsite/en/contact

MyWebsite/contact.aspx?lang=de => MyWebsite/de/contact MyWebsite/brand.aspx?lang=de&id=12 => MyWebsite/de/brand/12

curveball
  • 4,320
  • 15
  • 39
  • 49
  • What you are asking-for, is more like the way things are done in MVC and not really in ASP.NET web forms. It is possible to do this in ASP.NET, but it is much more work. You might find it easier to switch to MVC or stick with a more web-forms way of handling this requirement. Are you open to alternatives or would you prefer to stick with your approach? – tgolisch Oct 02 '18 at 15:26
  • Take a look at this S/O post. It does a great job of showing what I mean. https://stackoverflow.com/questions/25385532/how-to-add-aspx-pages-to-existing-mvc-4-project – tgolisch Oct 02 '18 at 15:54
  • We are about to finish our project. want to change the active language to make better seo but I'm having problems. is there a way to solve this problem – Kerem Yıldırım Oct 02 '18 at 15:57

0 Answers0