Click here to Skip to main content
16,013,440 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How do i ASP.Net Dropdownlist that is used to link to another URL with Id

This dropdown links redirect to another page with Id in onchage
or
using master and child pages content show in same page
<asp:DropDownList ID="ddl" runat="server" >
       <asp:ListItem Text="Collage fee" Value="CollegeFee.aspx" > 
       <asp:ListItem Text="Hospital fee" Value="Hostalfee.aspx" >
       <asp:ListItem Text="Sports fee" Value="Sprtsfee.aspx" >
       <asp:ListItem Text="Other fee" Value="otherfee.aspx">
Posted
Updated 4-Sep-14 0:55am
v3
Comments
Sinisa Hajnal 4-Sep-14 6:27am    
Unclear. Please clarify what you want/need and provide your markup and/or code with the problem.

Thank you

i got this solution but ithink ineed some modification

<asp:dropdownlist id="ddl" runat="server" onchange="document.location.href=this.value;" xmlns:asp="#unknown">
<asp:listitem text="Collage fee" value="CollegeFee.aspx">
<asp:listitem text="Hospital fee" value="Hostalfee.aspx">
<asp:listitem text="Sports fee" value="Sprtsfee.aspx">
<asp:listitem text="Other fee" value="otherfee.aspx">

 
Share this answer
 
I think you want to open a page when changing drop down list item. Please see this forum question and answer.

http://stackoverflow.com/questions/18592907/asp-net-redirect-a-page-in-new-tab-on-dropdown-list-onselectedindexchanged-by-pa[^]
 
Share this answer
 
Comments
Prasanth Radhakrishanan 4-Sep-14 7:15am    
thank you

Yes this is good another option i need change only contents in this page when changing drop down list item
help me ?
Gihan Liyanage 4-Sep-14 7:22am    
Dont you need to navigate through pages when selecting ?
Prasanth Radhakrishanan 4-Sep-14 7:31am    
yes i need this and i got page redirection for you are help

now i want change collage-fee, hostal fee ,etc.. in same page change only content when onchange Drop down list item
Gihan Liyanage 4-Sep-14 7:39am    
Then you need to have Div tag or panels to change contents of same page. This may be an another task. Better to ask from community "change contents of asp.net page when change drop-down list".. Some thing like that..
Prasanth Radhakrishanan 5-Sep-14 3:03am    
thank you

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