Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
On clicking a link I want to call the same page(default.aspx). But I want to add the QueryString as < A href="/KB/answers/Default.aspx"?fg=5"> CLICK < /a>
The value 5 is got from a combobox.

How to add that value?

XML
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
Posted
Updated 21-Jan-15 8:06am
v2
Comments
Zoltán Zörgő 21-Jan-15 13:47pm    
How do you create this link on first place?
sunpop 21-Jan-15 14:03pm    
I want to add the selected value of Combo to the href attribute of

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

CLICK</td>


ie, JUN14 should be the selected value of combo
Zoltán Zörgő 21-Jan-15 14:25pm    
Ok, but post also the part where you emit the code of the link itself.
sunpop 21-Jan-15 14:34pm    
I need somewhat like : < a href="Temp.aspx?mon="+selected value of combo >CLICK< /a>

1 solution

< a href="/KB/answers/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/[^]
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900