I have an Asp.Net website which should have a variable as a string in the url.
The content of the website changes depending on the year. the idea is to have this year in the url in a clean way.
http://localhost/YEAR/index.aspx
I have done this in MVC with routing, but i have no idea how to do it in asp.net.
I basically need just 1 route I guess. so all URL’s will be as they were before (index.aspx, …)
basically in stead of having ?year=2011 behind EVERY url in the website i’d like to have this value in the route.
How and what should i use for that? rewriting or routes?
Have a look here http://urlrewriter.net/
Download the assembly, add this as a reference in your project.
In web.config file in configSections element add this
create one more section
try to get the content you need with this http://localhost/2011.aspx
I Hope this helps