Link to home
Start Free TrialLog in
Avatar of TrialUser
TrialUserFlag for Afghanistan

asked on

asp.net routing without mvc, ASP.net 4.0

I am trying to implement asp.net routing without MVC. With the code I have so far I am able to route and pass a parameter. My url looks like:
http://localhost:47261/Category/30

Now, what I need to be able to achieve is somethng like  :
http://localhost:47261/SchoolSuply/30

In other words "Category" should not be hard coded and I should be able to change it to anything and still the website is not broken. How can I achieve this? I am working with VB.net, ASP.net 4.0

The code I have so far is :
Global.asax.vb:

 routes.MapPageRoute("Categories", "Category/{CategoryName}", "~/Category.aspx").

In the default page I do ;
Response.RedirectToRoute("Categories", New With {.CategoryName = txtCategory.Text.Trim})
Please help. Thanks
ASKER CERTIFIED SOLUTION
Avatar of Maverick543
Maverick543

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial