Click here to Skip to main content
13,090,446 members (46,459 online)
Rate this:
Please Sign up or sign in to vote.
See more:
in my web application i have 2 dropdowns for a button click i need to bind the url from database corresponding to the selected categories...

For example

my url----> http://localhost:1232/tollfree.aspx

im selecting category1 as ---->Jewellery Shops
category2 as ---->ABC Diamonds

after button click my url should be


how can i bind this url from database???
Posted 21-Feb-13 22:15pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Try this:
string AddValue = "abc-diamonds-toll-free-number"; //Suppose "abc-diamonds-toll-free-number" is coming from database.
stirng absoluteURL = Request.Url.AbsoluteUri + "/" + AddValue;

Now you can redirect your application to absoluteURL.

sundarpks 22-Feb-13 4:56am
Thanks Amit 4 ur reply

but if do another search url gets added like tis...

_Amy 22-Feb-13 5:03am
Welcome. :)
Everytime you need to clear the string absoluteURL after using it.
absoluteURL = "";

sundarpks 22-Feb-13 5:17am
i hv already tried this...

AbsoluteUri gets changed after wen v add our database driven url to this AbsoluteUri it goes on adding.....
_Amy 22-Feb-13 5:20am
Oh! I missed that one. First time store Request.Url.AbsoluteUri in session/hidden field. And every time take it from session/hidden field.

sundarpks 22-Feb-13 5:37am
ya i too thought of tat....but wat i exactly need is like url rewriting from database in which v can use tat url in future.... jus like search engines....
_Amy 22-Feb-13 5:53am
Then take a look at these links:
URL Rewriting with ASP.NET[^]
URL Rewriting in ASP.NET[^]
sundarpks 22-Feb-13 6:19am
Thanks Amit for ur replies....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170813.1 | Last Updated 22 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100