Event doesn't launch in ASCX control

D

Diego F.

Hi all. I'm using VS2005 Beta 2 and I encountered a problem with an event.

I had a User Control with a DataGrid with a CheckBox column like that:

<asp:TemplateColumn>
<ItemTemplate>
<asp:CheckBox AutoPostBack="false" ID="chkSel"
runat="server" EnableViewState=true
OnCheckedChanged="HtmlCheckBox_ServerChange" />
</ItemTemplate>
</asp:TemplateColumn>

It was working properly, but I had to include that DataGrid in other user
control, that I registered in the previous user control. Now, the event
doesn't run.

Is there any problem nesting user controls?
 
K

kingadrock

Well first thing that caught my eye was this - AutoPostBack="false"

but also - your user control, if you're adding it to your page
dynamically make sure you do it in the OnInit not in the Page_Load
 
D

Diego F.

Well first thing that caught my eye was this - AutoPostBack="false"

but also - your user control, if you're adding it to your page
dynamically make sure you do it in the OnInit not in the Page_Load

Thank you for posting.

The AutoPostBack=false is to avoid continuously loads in the page that can
disturb the user, so I wait until the user changes the page or clicks a
button.

The question here is that before using another control inside the main
control, it worked perfectly. It seems to be any limitation with that.
 
K

King Adrock

So you are sticking this control inside of a user control and then
dragging and dropping it onto your aspx page?

or are you adding it to your page dynamically use Page.LoadControl? If
so you need to do that before page_load so your events will work
correctly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top