基于asp.net中的下拉列表重定向网页 [英] redirect webpage based upon dropdownlist in asp.net
问题描述
亲爱的朋友们,
如何根据Asp.Net中的下拉列表重定向页面c#?
当我从下拉列表中选择一个页面时,我的项目中有3个网页。它应该重定向到那个页面,并且应该显示该页面。
我的页面是:
1 )attendanceReports.aspx
2)考试报告.aspx
3)OtherReports.aspx
我的下拉列表是as
-----选择报告-----
出勤报告
考试报告
其他报告
Dear Friends,
How to redirect Pages Based on Dropdownlist in Asp.Net c#?
I have 3 webpages in my project, when i select one page from dropdownlist. it should redirect to that page and that page should be displayed.
My pages are :
1)AttendanceReports.aspx
2)Exam Reports.aspx
3)OtherReports.aspx
my Dropdown is as
----- Select Report -----
Attendance Report
Exam Report
Other Reports
推荐答案
<select id="redirect" onchange="location.href=this.value;">
<option value="" selected disabled>Select report!</option>
<option value="AttendanceReports.aspx">Attendance Report</option>
<option value="ExamReports.aspx">Exam Report</option>
<option value="OtherReports.aspx">Other Reports</option>
</select>
但这是纯粹的客户端,如果您需要其他一些操作服务器端也可以使用该方法,请参阅: http:// msdn.microsoft.com/en-us/library/540y83hx(v=vs.100).aspx [ ^ ]
这篇关于基于asp.net中的下拉列表重定向网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!