我们可以在usercontrol中使用asp.net页面(内容页面)方法或事件 [英] can we asp.net page (content page ) methods or events in usercontrol

查看:69
本文介绍了我们可以在usercontrol中使用asp.net页面(内容页面)方法或事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net中使用usercontrol(ascx)



在asp.net中放置或注册usercontrol后



我们可以从用户控件(ascx)触发或调用asp.net页面方法或事件吗?



如果是,那么如何?



提前感谢

I am working with usercontrol (ascx ) in asp.net

after placing or register usercontrol in asp.net

can we fired or invoke asp.net page methods or events from user control (ascx) ?

if yes then how ?

thanks in advance

推荐答案

事件在asp.net核心框架下自动触发。你无法手动触发那些。只是你可以为那些绑定或取消绑定事件处理程序。如果需要重用任何逻辑,则将其写入任何辅助方法并从适当的事件处理程序中调用它。
Event is fired automatically under asp.net core framework. You can not manually fire those. Just you can bind or unbind event handler for those. If any logic you need to reuse then write it to any helper method and call it from your appropriate event handler.


这篇关于我们可以在usercontrol中使用asp.net页面(内容页面)方法或事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆