Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3960250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:49:54+00:00 2026-05-20T02:49:54+00:00

I have an Asp.Net website which should have a variable as a string in

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:49:55+00:00Added an answer on May 20, 2026 at 2:49 am

    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

    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
    

    create one more section

    <rewriter>    
    <rewrite url="http://localhost/(.*).aspx" to="http://localhost/index.aspx?year=$1"/>
    </rewriter>
    

    try to get the content you need with this http://localhost/2011.aspx

    I Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.Net hosted website which displays a list of results as a
I have an existing ASP.NET website which I would like to painlessly add CMS
We have a large ASP.Net website that has a single css stylesheet which is
I have an asp.net website which contains a few pages that I'd like to
i have a asp.net mvc website which runs a number of queries for each
I have an ASP.NET v2 website which uses NHibernate for ORM. My current architecture
I have an ASP.NET website, but this question isn't really about technology, it is
We have hundreds of websites which were developed in asp, .net and java and
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net
I have an ASP.NET website and when I press F5 it automatically attaches to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.