如何使用导航网址属性连接文本? [英] how to concatenate text with navigate url property?
本文介绍了如何使用导航网址属性连接文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的下面的超链接控件正常运行代码..只有我想要的是在导航网址属性前面添加page23.aspx?cat = shoes。我正在尝试但是当我这样做时它不会添加带有导航的区域..它显示全文而不是从数据库中撤回区域..
< asp:HyperLink ID = HyperLink1 runat = server NavigateUrl = ' <%#DataBinder.Eval(Container.DataItem,area)%>' > <%#DataBinder.Eval (Container.DataItem, area)%>
解决方案
你应该尝试java脚本,希望你的问题能解决。我已经提供样品请根据您的要求检查和修改
javascript代码如下:
< script type = text / javascript >
function openWindowForNavigation(){
//使用查询字符串获取当前网址
var query = document.location.href;
window.open(查询+'& cat ='+ 50);
}
< / script >
,您的超链接是
< asp :HyperLink ID = HyperLink1 runat = server NavigateUrl = javascript:openWindowForNavigation(); > 跨度>超链接
My below hyperlink control is working fine with the code.. only what i want is to add page23.aspx?cat=shoes in front of the navigate url property. i am trying but when i do like this it doesn't add area with navigateurl.. it shows full text instead of retreving area from database..
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl= '<%# DataBinder.Eval(Container.DataItem, "area") %>'> <%# DataBinder.Eval(Container.DataItem, "area") %>
解决方案
you should try java script for that hope your problem will resolve. i have give a sample please check and modify as per your requirement the javascript code is as : <script type="text/javascript"> function openWindowForNavigation() { // getting the current url with query string var query = document.location.href; window.open(query +'&cat='+50); } </script> and your hyperlink is <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="javascript:openWindowForNavigation();">HyperLink
这篇关于如何使用导航网址属性连接文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文