复制代码 代码如下:
<label>发布栏目:<asp:DropDownList runat="server"></asp:DropDownList></label
复制代码 代码如下:
SourceDb DropDwonListData = new SourceDb();
string DropDwonSelect = "SELECT * FROM [Section]";
sectionDropDownList.DataSource = DropDwonListData.DatasetDb(DropDwonSelect).Tables[0].DefaultView;
sectionDropDownList.DataTextField = "name";
sectionDropDownList.DataValueField = "code";
sectionDropDownList.DataBind();
复制代码 代码如下:
string newsTitle = sectionDropDownList.SelectedValue;
Response.Write(newsTitle);
复制代码 代码如下:
<label>发布栏目:<asp:DropDownList runat="server"></asp:DropDownList></label
复制代码 代码如下:
if(!IsPostBack){
SourceDb DropDwonListData
= new SourceDb();
string DropDwonSelect = "SELECT * FROM [Section]";
sectionDropDownList.DataSource = DropDwonListData.DatasetDb(DropDwonSelect).Tables[0].DefaultView;
sectionDropDownList.DataTextField = "name";
sectionDropDownList.DataValueField = "code";
sectionDropDownList.DataBind();
}
复制代码 代码如下:
string newsTitle = sectionDropDownList.SelectedValue;
Response.Write(newsTitle);
新闻热点
疑难解答
图片精选