如何用于链接到具有Id的另一个URL的Asp.Net下拉列表 [英] How Do I Asp.Net Dropdownlist That Is Used To Link To Another Url With Id

查看:49
本文介绍了如何用于链接到具有Id的另一个URL的Asp.Net下拉列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何使用ASP链接到另一个URL的ASP.Net下拉列表



此下拉链接链接重定向到另一个页面,ID为onchage



使用同一页面显示的主页和子页面内容

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">

推荐答案

我认为您想要在更改下拉列表项时打开页面。请看这个论坛的问题和答案。



http://stackoverflow.com/questions/18592907/asp-net-redirect-a-page-in-new-tab-on- dropdown-list-onselectedindexchanged-by-pa [ ^ ]
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[^]


我得到了这个解决方案,但是ithink进行了一些修改



< asp:dropdownlist id =ddlrunat =serveronchange =document.location.href = this.value; xmlns:asp =#unknown>

< asp:listitem text =Collage feevalue =CollegeFee.aspx>

< asp:listitem text =医院费用value =Hostalfee.aspx>

< asp:listitem text =体育费用value = Sprtsfee.aspx>

< asp:listitem text =其他费用value =otherfee.aspx>


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">


这篇关于如何用于链接到具有Id的另一个URL的Asp.Net下拉列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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