I'm using ASP.NET routing to map URLs to some arbitrary number of sections to my site. They will all be handled by the same page, though I want to have different URLs. For example
http://site.com/blog for my blog section
http://site.com/mysection for mysection etc.
There can be any number of those sections, but they will all be handled by Lister.aspx.
I also have another page that handles the content, named ContentView.aspx which shows off content. My route is as follows: (cats is list of categories)
cats.ForEach(c =>
{
table.Add(new Route(c.ShortName, new PageRouteHandler("~/Lister.aspx?cat=" + c.ID), ));
table.Add(new Route(c.ShortName + "/{id}", new PageRouteHandler("~/ContentView.aspx")));
table.Add(new Route(c.ShortName + "/{id}/{title}", new PageRouteHandler("~/ContentView.aspx")));
});
Let's say I have a blog post with ID 123 and title hello:
A user can access it by http://site.com/blog/123/hello
They can also use just the ID http://site.com/blog/123
As you may guess, I want http://site.com/blog to point to the lister page instead of a content viewer, and I also need the category ID to distinguish which category (blog or mycategory or anything else that was created dynamically) I should display. I'm trying to pass the category ID to the querystring, the lister page is called, but with no query string. Why is this behavior, and how can I send my category ID to the lister page?