来自数据库的动态URL绑定 [英] dynamic url binding from database
问题描述
在我的网络应用程序中我有2个类别的下拉菜单...在按钮单击中我需要绑定来自与所选类别对应的数据库的URL ...
例如
我的网址----> http:// localhost:1232 / tollfree.aspx
我选择category1作为---->珠宝店
category2 as - ---> ABC钻石
按钮点击我的网址后应该是
http:// localhost:1232 / tollfree.aspx / abc-diamonds-toll-free-number
如何从数据库中绑定这个url? ?
试试这个:
string AddValue = abc-diamonds-toll-free-number; // 假设abc-diamonds-toll-free-number来自数据库。
stirng absoluteURL = Request.Url.AbsoluteUri + / + AddValue;
现在您可以将应用程序重定向到 absoluteURL 。
使用:
Response.Redirect(absoluteURL);
--Amit
in my web application i have 2 dropdowns for categories...in 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
http://localhost:1232/tollfree.aspx/abc-diamonds-toll-free-number
how can i bind this url from database???
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.
Use:
Response.Redirect(absoluteURL);
--Amit
这篇关于来自数据库的动态URL绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!