Controls not Generating from OnInit and DataGrid Event Problem !

P

poi

I define controls completely in code in a PrepControls() method. I put
the method in here:

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
PrepDynamicControls();
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

But the controls do not show. If I move them to the Page_Load event,
they show fine.


Also, one of the controls I dynamically build is a DataGrid. It gets
populated from a DataSet that gets populated from within a
textbox_TextChanged event handler. The DataGrid shows fine. If I click
on the LinkButton column in the grid, the grid disappears (which is OK)
but none of the DataGrid Events fire. I know this because I have VS.NET
breakpoints setup and none get called. By contrast, I build an
ImageButton the same way, and its event always fires.

Help!
 

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

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top