Dynamically Loading User Controls

R

Rick Mavrovik

Hi,
I am trying to generate a number of Web User Controls (WUC) based on user
input.

This WUC has got 2 drop down controls in it. The WUC works fine when created
in the usual manner but when I try to create it dynamically a null reference
exception is thrown when trying to refering any of the drop down.

UCUserToDeviceInBulk ucTemp = new UCUserToDeviceInBulk();
ucTemp.Visible = true;
ucTemp.LoadData(Convert.ToInt32(ddlClient.SelectedItem.Value));
Inside the LoadDate when I try to use the any of the drop down list.. a null
reference exception occurs

public void LoadData(int clientID){
ddlUser.CssClass = "GAMADdlNormal";
}

Does anyone have any clue why this is happening.

Thanks

-Rick
 
R

Rick Mavrovik

I create the WUCs in button click event.
The creation of the WUC goes ahead fine. the line below doest not cause the
error
UCUserToDeviceInBulk ucTemp = new UCUserToDeviceInBulk();

-Sami
 

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,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top