62,052
社区成员
发帖
与我相关
我的任务
分享
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (Request.QueryString["id"] != null)
{
//获取标签
int id = Convert.ToInt32(ts.getId("标签"));
RecordService rs = new RecordService();
this.DropDownList1.DataSource = rs.getlist(id, 50);
this.DropDownList1.DataTextField = "rContent";
this.DropDownList1.DataValueField = "rId";
this.DropDownList1.DataBind();
}
}
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
string title = DropDownList1.Text;
this.tagarea.Value += title + ",";
}
<td height="40" align="right">
标签:
</td>
<td>
<asp:DropDownList CssClass="tag" ID="DropDownList1" runat="server"
onselectedindexchanged="DropDownList1_SelectedIndexChanged"
AutoPostBack="True" ondatabound="DropDownList1_DataBound"></asp:DropDownList>
</td>