I am using ASP.Net web form Routing for my website but i want to make it more structure & hide all the Querystring ID's with proper Structure like Language/Category/PageName-Title
example: www.abc.com/en/sports/cricket-world-cup
but with my current routing technique i am able to make it work as
www.abc.com/en/1/13/cricket-world-cup
domain/english-folder/language-id/page-id/page-title
How can i make it more structured as `www.abc.com/en/sports/cricket-world-cup
Since i have few Query-string i designed it this way
//For Page.aspx
routes.MapPageRoute("Page_Route", "en/page/{LID}/{PID}/{PageName}", "~/en/Page.aspx", false,
new RouteValueDictionary {
{ "LID", "0"},
{ "PID", "0" },
{ "PageName", "Page-not-found" }},
new RouteValueDictionary {
{ "LID", "[0-9]{1,8}" },
{ "PID", "[0-9]{1,8}" },
});
Result of above Routing get me Friendly URL like this
www.abc.com/en/1/13/cricket-world-cup
But i want to further structure the URL like the one in example.
www.abc.com/en/sports/cricket-world-cup
Example: This url i found is more structure/
http://www.thenational.ae/news/world/europe/turkey-providing-jobs-a-future-for-more-greeks
How can i implement the same structure are they passing querystrings
as hiddenfields. Please suggest best approach for such url.
another example is http://mashreqbank.com/uae/en/corporate/lending/trade-finance.aspx
they are using asp.net but i am not sure if it is ASP.Net MVC or ASP.Net webform.
I have been struggling with this kind of routing for quite long and even i cant find a complete example which can take into consideration more than one query-string as most of the example are based on one query-string.
Any help from coding gurus with example would be highly appreciated.
UPDATE: Let us take this Table into consideration which i use to store page name, title, handler, language regions etc.. This is just a demo table & doesnt resemble the actual website which i am refering to for sample structured url. I am not even sure if they are going it using URL routing or these are actual physical folder & files like old style website where you create actual folder and place files in their etc..
Page_ID Page_Name Page_Title Page_Handler Parent_Page_ID Language_ID Region_ID
1 Home Home index.aspx 0 1 uae
2 Personal Personal index.aspx 0 1 uae
3 Accounts & Deposits Accounts & Deposits index.aspx 2 1 uae
4 Current Account Current Account current-account.aspx 3 1 uae
5 Current Gold Accounts gold Account gold-account.aspx 3 1 uae
6 Easy Saver Easy Saver Account saver-account.aspx 3 1 uae
7 Fixed Deposits Fixed Account fixed-account.aspx 3 1 uae
8 Loans Loans index.aspx 2 1 uae
9 Personal Loans Personal Loans index.aspx 8 1 uae
10 car Loans car Loans car-loan.aspx 8 1 uae
website example for above structure http://mashreqbank.com/
We can use a common page handler if the page design is same this is what i am assuming let us say page.aspx
,
Pleae feel to make changes to structure and data inorder to achieve the desired result.