My website is .net 4 and I want to implement routing instead of Query String which i currently use.
To apply Routing, the prerequsition is you need to grasp ASP.NET Routing, to through the document below and do some research, will resolve what you are confused about:
prontonet
Member
243 Points
484 Posts
asp.net 4 rerouting friendly URLs still confused?
May 30, 2012 12:15 AM|LINK
Hi.
i wrote briefly about this earlier on another post but I think it deserves its own one.
My website is .net 4 and I want to implement routing instead of Query String which i currently use.
My Setup is as follows
Database
Data Table called Genre with GenreId as primary key. Also have column called "Name" which shows
pop, rock, jazz etc
Artist Data Table with ArtistId as primary key.
I also have junction table called ArtistGenre with GenreId and ArtistId primary keys
Default Aspx Page
This has a repeater bound to object data source with a Method Called GetGenre.
This simply display all the Genre from the Data Table on the page.
In the item template I jave a A href Tag that i want to point to the Music.aspx page below
Music.Aspx page
I have a Gridview with an Object Data Source that has a method GetArtistByGenreId
This basically returns all the artists that belong to the genre clicked on from Default page.
So say Blues was selected, the Music page would show all artist that are listed as genre blues.
Desired solution
When a user selects a genre on Default.aspx - I want them to be taken to a page like Music/Pop (And not Music/43 (umber of GenreId)
and on this page the artists that have a genre selected as Pop will be shown
Thank you for help in setting this up
Curt_C
All-Star
66014 Points
7639 Posts
Moderator
Re: asp.net 4 rerouting friendly URLs still confused?
May 31, 2012 01:33 PM|LINK
show the line of code where you build the HREF.
Odds are you are passing the ID instead of the NAME is all...., this is exactly what was mentioned (and code shown) in your previous thread.
v5.1 of iTracker (Inventory Tracker Starter Kit) is out, Download it now!
Mamba Dai - ...
All-Star
23531 Points
2683 Posts
Microsoft
Re: asp.net 4 rerouting friendly URLs still confused?
Jun 05, 2012 06:23 AM|LINK
Hi,
To apply Routing, the prerequsition is you need to grasp ASP.NET Routing, to through the document below and do some research, will resolve what you are confused about:
http://msdn.microsoft.com/en-us/library/cc668201.aspx
Feedback to us
Develop and promote your apps in Windows Store
pnkmouli
Member
64 Points
17 Posts
Re: asp.net 4 rerouting friendly URLs still confused?
Nov 15, 2012 02:10 PM|LINK
Hi ,
Have a look below link
http://www.hanselman.com/blog/IntroducingASPNETFriendlyUrlsCleanerURLsEasierRoutingAndMobileViewsForASPNETWebForms.aspx
It's very easy to add routing to asp.net forms based website.
Novel K Mouli
http://www.autocars.co.in
Durham,
United Kingdom.
Remember to click “Mark as Answer” on the post, if it helps you.