Access User Control value during Page_Load

C

Cindy

ASP.NET - C# (User Control)

I have a drop-down as usercontrol.

In the user control's Page_Init , the drop down gets
populated.

The SelectedItem.Text is retrived using property get
The Value of the drop-down is assigned using property set.

This user control is placed on an aspx page on which I am
trying
to assign the control a value.

I tried this in the Page_Load event of the aspx page - it
gives me this eror:-
Object reference not set to an instance of an object

It gives the same error in Page_PreRender event.

It works fine when tried in a button event.

The same logic works fine in VB but not in CSharp.

Any help will be appreciated.

Thanks
 
V

Victor Garcia Aprea [MVP]

Hi Cindy,

It will really help if you could post some of your code,
 

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,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top