.子控件与父页面
控件页
public class HistoryReplyEventArgs : EventArgs
{
NameValueCollection _ConditionCollection;
public NameValueCollection ConditionCollection
{
get { return this._ConditionCollection; }
}
public HistoryReplyEventArgs(NameValueCollection conditionCollection)
{
this._ConditionCollection = conditionCollection;
}
}
public partial class Task_Reply : System.Web.UI.UserControl
{
public delegate void ListHistoryReplyHandler(object sender, HistoryReplyEventArgs e);
public event ListHistoryReplyHandler ListHistoryReplyEvent;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GameBind();
}
}
protected void Button4_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TxtPhone.Text))
{
if (this.ListHistoryReplyEvent != null)
{
NameValueCollection conditionCollection = new NameValueCollection();
conditionCollection.Add(TASK_Question.n_.ContactPhone, TxtPhone.Text);
ListHistoryReplyEvent(this, new HistoryReplyEventArgs(conditionCollection));
}
}
}
父:
Task_Reply1.ListHistoryReplyEvent += ListHistoryEmailReply;
protected void ListHistoryEmailReply(object sender, CSPlatform.Website.Admin.Controls.HistoryReplyEventArgs e)
{
//历史回复
DataTable DT = this.TaskContext.Task.ListTaskQuestion(e.ConditionCollection, 5);
RepEmailHistory.DataSource = DT;
RepEmailHistory.DataBind();
}
控件页
public class HistoryReplyEventArgs : EventArgs
{
NameValueCollection _ConditionCollection;
public NameValueCollection ConditionCollection
{
get { return this._ConditionCollection; }
}
public HistoryReplyEventArgs(NameValueCollection conditionCollection)
{
this._ConditionCollection = conditionCollection;
}
}
public partial class Task_Reply : System.Web.UI.UserControl
{
public delegate void ListHistoryReplyHandler(object sender, HistoryReplyEventArgs e);
public event ListHistoryReplyHandler ListHistoryReplyEvent;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GameBind();
}
}
protected void Button4_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(TxtPhone.Text))
{
if (this.ListHistoryReplyEvent != null)
{
NameValueCollection conditionCollection = new NameValueCollection();
conditionCollection.Add(TASK_Question.n_.ContactPhone, TxtPhone.Text);
ListHistoryReplyEvent(this, new HistoryReplyEventArgs(conditionCollection));
}
}
}
父:
Task_Reply1.ListHistoryReplyEvent += ListHistoryEmailReply;
protected void ListHistoryEmailReply(object sender, CSPlatform.Website.Admin.Controls.HistoryReplyEventArgs e)
{
//历史回复
DataTable DT = this.TaskContext.Task.ListTaskQuestion(e.ConditionCollection, 5);
RepEmailHistory.DataSource = DT;
RepEmailHistory.DataBind();
}