<%# "<br/>"+Eval("留言內容").ToString.Replace(Chr(10), "<br />") %>
4月 01, 2010
gridview的連動式下拉選單
protected void ddlDepNum_1Level_DataBound(object sender, EventArgs e)
{
DropDownList ddl_tmp_dep = ((DropDownList)sender); //上層 部門資料
DropDownList ddl_tmp_emp = ((DropDownList)sender).NamingContainer.FindControl("ddl_emp") as DropDownList; //下層 部門員工資料
SqlDataSource SqlDataSource_emp = ((DropDownList)sender).NamingContainer.FindControl("sdsEmpNum") as SqlDataSource; //下層的datasource
SqlDataSource_emp.SelectParameters["Dept"].DefaultValue = ddl_tmp_dep.SelectedValue; //上層的部門代碼參數
ddl_tmp_emp.DataBind();
}
在 ddlDepNum_1Level_SelectedIndexChanged() 事件也一併使用
訂閱:
文章 (Atom)