如何使用链接referance添加查询字符串? [英] How to add querystring with link referance?

查看:61
本文介绍了如何使用链接referance添加查询字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击链接我要调用同一页面(default.aspx)。但我想将QueryString添加为< HREF =Default.aspx?fg = 5>点击< / a>

值5来自组合框。



如何添加该值?



On clicking a link I want to call the same page(default.aspx). But I want to add the QueryString as < A HREF="Default.aspx?fg=5"> CLICK < /a>
The value 5 is got from a combobox.

How to add that value?

I want to add the selected value of Combo to the href attribute of <a>

<dx:ASPxComboBox ID="ASPxComboBox1" runat="server" AutoPostBack="true" DataSourceID="SqlDataSource2"

onselectedindexchanged="ASPxComboBox1_SelectedIndexChanged" TextField="mnth" ValueField="mnth"></dx:ASPxComboBox>

<a href="Temp.aspx?mon=JUN14">CLICK</a></td>


ie, JUN14 should be the selected value of combo









提前致谢





Thanks in advance

推荐答案

< a href =Temp.aspx?mon =+选择的组合值> CLICK< / a>



无效。因为当页面已经呈现时,除非你使用Ajax或Javascript,否则无法从组合中获取值并将其放入链接。



要做以ASP.NET方式,使用 UpdatePanel 。 updatePanel的作用是页面的部分更新。按照链接有个主意。



http://asp.net -tutorials.com/ [ ^ ]
< a href="Temp.aspx?mon="+selected value of combo >CLICK< /a>

Will not work. Because when the page is already rendered, there is no way to get the value from the combo and put it into the link unless you use Ajax or Javascript.

To do it in ASP.NET way, use an UpdatePanel. What updatePanel does is the partial update of a page. Follow the link to have an idea.

http://asp.net-tutorials.com/[^]


这篇关于如何使用链接referance添加查询字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆