0
我正在與C#和asp.net 2.0在此上。 1)Webfrom1包含文本框和員工搜索圖像按鈕。當我點擊圖像按鈕時,彈出與employeelist.webforms。如何從列表視圖獲取數據作爲字符串C#asp.net
2)在employeelistwebform中,它包含filterby:(combobox),搜索按鈕,兩個listview, Ok按鈕和Cancle按鈕。 3)在listview1它會綁定filiterby員工代碼。然後用戶可以移動選定的員工代碼。
4)然後點擊確定,我希望選定的emplyeecodes能夠顯示在Webform1的搜索圖像按鈕的文本框中,並自行關閉employeelistwebforms。
e public void bttOK_Click(object sender, System.EventArgs e)
{
string ListlbAppGroup = Convert.ToString(Request.Form.GetValues("listName2"));
// ListLbAppGroup is always null.I dont know how to get the selectedvalue from listview.
string litPeriod = "";
listName2.Items.Clear;
LoadListEmployee();
if (Request.Form.GetValues("listName2")==null)
{
for (int i = 0; i <= ListlbAppGroup.Length - 1; i++)
{
//listName2.Items.Add(new ListItem (ListlbAppGroup[i].ToString().Split['|'][1],ListlbAppGroup[i].Split["|"][0]));
//listName.Items.Remove(new ListItem(ListlbAppGroup[i].Split['|'][1],ListlbAppGroup[i].Split["|"][0]));
//litPeriod+= ","+ListlbAppGroup[i];
listName2.Items.Add(new ListItem(ListlbAppGroup[i],ListlbAppGroup[i]));
listName2.Items.Remove(new ListItem(ListlbAppGroup[i],ListlbAppGroup[i]));
}
}
txtPeriod.Value = litPeriod;
Page.RegisterStartupScript("close", "<script language='javascript'>window.returnValue= '" + litPeriod + "';window.close();</script>");
}nter code here