如何使用表将dropdownlist值从一个页面显示到另一个页面 [英] how to display dropdownlist value from one page to another page using table

查看:91
本文介绍了如何使用表将dropdownlist值从一个页面显示到另一个页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

表如下(Course_settings表)

Table as follows (Course_settings table)

Course   Type
RM      RM 8 Days
REO     REO 5 Days





首页设计如下



在Dropdownlist1中,coursename如下



First page design as follows

In Dropdownlist1 coursename as follows

RM
REO





第二页设计为关注

Dropdownlist2。



当我从第一页的Dropdownlist1中选择RM课程时。我想在Course_settings表中显示RM 8 Days以显示到第二页dropdownlist2页面。



为此我怎样才能在asp.net中使用c#。



Second page design as follows
Dropdownlist2.

When i select the course RM from the Dropdownlist1 in first page. i want to display the RM 8 Days from the Course_settings table to display into the second page dropdownlist2 page.

For that how can i do in asp.net using c#.

推荐答案

阅读如何:在ASP.NET Web窗体页面之间传递值 [ ^ ]

使用其中一种方法并将Dropdownlist1选择的值发送到第二页。当你绑定第一个Dropdownlist时,将DataValueField和DataTextField设置如下



Read How to: Pass Values Between ASP.NET Web Forms Pages[^]
use one of the way and send the Dropdownlist1 selected value to 2nd page. when you bind first Dropdownlist set both DataValueField and DataTextField as below

ddl.DataSource = dataTable; //select [Type], Course from Course_settings 
ddl.DataValueField = "Type"
ddl.DataTextField = "Course"



将值传递给第二页时,可以使用ddl.SelecteValue [ ^ ]获取相应的类型并将其发送到第二页


when you pass the value to 2nd page, you can use ddl.SelecteValue[^] to get the coresponding Type and send it to 2nd page


这篇关于如何使用表将dropdownlist值从一个页面显示到另一个页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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