我有一個字符串列表,它是在imagebutton_click方法上生成的。我希望能夠在另一個網頁中使用此列表。在Asp.Net網頁之間發佈數據
我怎麼不知道如何去發佈它在兩頁之間。
下面我有以下代碼:
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
RadGrid rg = RadGrid1;
//Get selected rows
GridItemCollection gdc = (GridItemCollection)rg.SelectedItems;
foreach (GridItem gi in gdc)
{
if (gi is GridDataItem)
{
GridDataItem gdi = (GridDataItem)gi;
if (!string.IsNullOrEmpty(gdi["Email"].Text))
{
string client = gdi["Email"].Text;
//Creating a List of Clients to be Emailed
emailList.Add(email);
}
}
//Enable the Prepare Email Page
PageView2.Selected = true;
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
if (emailList.Count != 0)
{
for (int i = 0; i < emailList.Count; i++)
{
_to = emailList[i].ToString() + ";";
}
}
else
{
_to = emailList[1].ToString();
}
//Processing Client Email
string _from = sec.GetCurrentUserEmail("test");
string _cc = "";
string _subject = SubjectTB.Text;
string _body = EmailEditor.Content;
string _tempTo = sec.GetCurrentUserEmail("temp");
string _msg = sec.SendMail(_tempTo, _cc, _from, _subject, _body, "");
if (_msg == "success")
{
//Thank the user and record mail was delivered sucessfully
TestPanel.Visible = true;
}
}
我如何獲得的emailList的值通過傳遞給ImageButton2_click(對象發件人,ImageClickEventArgs E)。目前它只是通過一個空值。我收集我需要使用HTML表單來完成請求。謝謝。
是的,它是一個私人的全局變量。我將如何去保存和加載控制狀態。謝謝。 – user1155383 2012-01-31 07:35:22
已添加到答案。讓我知道它是否有效。 – 2012-01-31 11:57:06