【发布时间】:2011-08-22 10:46:35
【问题描述】:
我有 ascx 假设 A.ascx 我正在像这样在 OnInit() 上编写一个委托
btnUpdate.Click += delegate
{
if (MaxLength.HasValue && txtText.Text.Length >= MaxLength.Value)
{
lblError.Text = string.Format(Resources.ErrorMessage_FieldLength, MaxLength);
return;
}
if (Update != null) Update(this, EventArgs.Empty);
};
现在我想在 B.ascx btn click 上调用这个委托
protected void btnHdnAnswer_Click(object sender, EventArgs e)
{
// How to call above delegate..
}
请帮帮我
【问题讨论】:
-
请问您为什么在 mvc 项目中使用 Web 表单服务器端逻辑?
-
这看起来不像 MVC...
-
A 控件包含在 B 控件中,还是它们只是在同一个页面上?
-
@Tim Rogers:控件 A 像这样在控件 B 中,我正在使用控件 跨度>