来自数据库的动态URL绑定

编程入门 行业动态 更新时间:2024-10-28 04:25:57
本文介绍了来自数据库的动态URL绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在我的网络应用程序中我有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----> localhost:1232/tollfree.aspx im selecting category1 as ---->Jewellery Shops category2 as ---->ABC Diamonds after button click my url should be 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绑定

本文发布于:2023-10-16 00:38:14,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1495960.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:绑定   数据库   动态   URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!