如果动态加载了UserControl,则不会触发UserControl按钮的单击 [英] UserControl Button Click Does not Fire if UserControl Loaded Dynamically

查看:109
本文介绍了如果动态加载了UserControl,则不会触发UserControl按钮的单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友.
我有一个registration.aspx页面和
我在用户注册时使用的多个用户控件.
每个UserControl都包含一些TextBox和Next Button.next butoon有一个
Button_Click事件,它将用于将Next UserControl加载到
registration.aspx的PlaceHolder

如果有人对此有任何想法,请提供解决方案.
您的帮助是适用的.

Hello friends.
I am having a registration.aspx page and
multiple Usercontrol that i am using at the time of User Registration.
Each UserControl Contain Some TextBox and Next Button.Next butoon have a
Button_Click Event, Which will be used for load the Next UserControl in to the
PlaceHolder of registration.aspx

If Anybody have any idea regarding it, please provide a Solution.
Your help is Appriciable.

推荐答案

您好,

实际的问题是回发.请检查您是否在PageLoad中创建了userControl?如果不是,那么您需要在页面加载事件中创建控件.

当页面回发时,控件丢失了它的事件和其他信息.因此您需要在PageLoad事件中放置动态控件.

希望这些信息对您有帮助,

谢谢
-Amit
Hi,

Actually problem is with postback. Please check if you have created your userControl in PageLoad ? if not then you need to create your control in page load event.

When your page is postback, control lost it''s event and other information. so you need to place dynamic control in PageLoad event.

hope this information will help you,

thanks
-Amit


这篇关于如果动态加载了UserControl,则不会触发UserControl按钮的单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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