TrialUser
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("Categ ories", "Category/{CategoryName}", "~/Category.aspx").
In the default page I do ;
Response.RedirectToRoute(" Categories ", New With {.CategoryName = txtCategory.Text.Trim})
Please help. Thanks
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("Categ
In the default page I do ;
Response.RedirectToRoute("
Please help. Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.