如何以正确的方式动态加载 UserControls?
我基本上创建了一个门户系统,并且想要动态加载用户控件,现在我已经阅读了几篇关于此的文章,他们将它们加载到占位符中,我已经尝试过这个。但它似乎有点问题。没有更好的方法来管理视图状态等,
dotnetnuke 如何将控件注入区域/表格单元?那么视图状态是如何管理的呢?
提前致谢...
im basically creating a portal system, and want to load UserControls Dynamically, now i have read a couple of articles on this where they loading them into a placeholder, i have tried this. but it just seems a little buggy. its there not a better way to manage the viewstate etc
how does dotnetnuke do it where they inject the controls into regions/tablecells? and then how is the viewstate managed?
thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有任何 DNN 经验,但是如果您这样做,
这将动态加载控件并将其添加到页面。您需要确保执行
OnInit
,以便控件在加载视图状态之前存在。这样视图状态就会自动传递。I don't have any DNN expereience, however if you do
This will load the control dynamically and add it to the page. You want to make sure you do it
OnInit
so that the control exists before viewstate is loaded. This way viewstate will be handed automatically.