.net ASCX 通过自定义事件调用ASPX中的方法
2013-05-08 13:07
176 查看
直接上代码:
ASCX:
定义:
public delegate string Get_Filter_Del();
public event Get_Filter_Del Get_Filter_Event;
protected void PageI() {
if (Get_Filter_Event != null) {
string a= Get_Filter_Event();
}
}
调用:
protected void btnRaise_Click(object sender, EventArgs e)
{
PageI();
}
ASPX:
protected void r_ques_CheckedChanged(object sender, EventArgs e)
{
if (this.r_ques.Checked) {
this.PlaceHolder1.Controls.Clear();
ctl_sel_ques_list ctl_sel_list = (ctl_sel_ques_list)LoadControl("com/ctl_sel_ques_list.ascx");
this.PlaceHolder1.Controls.Add(ctl_sel_list);
ctl_sel_list.Get_Filter_Event += DealwithReceived;
ctl_sel_list.BindSelectQues_List();
}
}
private string DealwithReceived()
{
return "a";
}
转载:http://winsystem.ctocio.com.cn/153/11770653.shtml
ASCX:
定义:
public delegate string Get_Filter_Del();
public event Get_Filter_Del Get_Filter_Event;
protected void PageI() {
if (Get_Filter_Event != null) {
string a= Get_Filter_Event();
}
}
调用:
protected void btnRaise_Click(object sender, EventArgs e)
{
PageI();
}
ASPX:
protected void r_ques_CheckedChanged(object sender, EventArgs e)
{
if (this.r_ques.Checked) {
this.PlaceHolder1.Controls.Clear();
ctl_sel_ques_list ctl_sel_list = (ctl_sel_ques_list)LoadControl("com/ctl_sel_ques_list.ascx");
this.PlaceHolder1.Controls.Add(ctl_sel_list);
ctl_sel_list.Get_Filter_Event += DealwithReceived;
ctl_sel_list.BindSelectQues_List();
}
}
private string DealwithReceived()
{
return "a";
}
转载:http://winsystem.ctocio.com.cn/153/11770653.shtml
相关文章推荐
- 通过事件调用窗体间的方法
- C#多线程-不同线程之间通过事件委托封送调用方法
- iOS — 通过自定义framework,在调用的时候,里面的类扩展方法不能调用
- Android界面之----自定义的Dialog,然后利用回调方法,在调用处,进行Dialog中各按钮的事件处理。
- C#多线程-不同线程之间通过事件委托封送调用方法
- C#多线程-不同线程之间通过事件委托封送调用方法
- C#通过委托调用Button单击事件的方法
- C#多线程-不同线程之间通过事件委托封送调用方法(转)
- 通过WebBrowser中的脚本调用Delphi自定义的方法(How to call Delphi code from scripts running in a TWebBrowser)
- 怎样通过onclick事件调用form的id提交方法
- 自定义服务器控件通过反射调用页面方法
- C#多线程-不同线程之间通过事件委托封送调用方法
- .net 反射,通过自定义Attribute动态调用类方法
- Actionscript通过构造自定义事件和方法,谈谈可选参数的问题
- AVCaptureDevice中通过调用VideoZoomFactor方法调整焦距实现拉近拉远镜头进行拍照录制视频(动画缩放画面,不闪屏)
- 通过反射调用类内部的方法
- webview通过js调用android方法
- Unity3D 通过代码导入自定义格式地形的方法
- 关于layer.open弹出层单击事件如何调用父窗口方法的说明
- 通过接口调用方法,接口一直为null的解决方法