all groups > asp.net building controls > june 2004 >
You're in the

asp.net building controls

group:

Access User Control value during Page_Load


Access User Control value during Page_Load Cindy
6/25/2004 5:19:07 AM
asp.net building controls:
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



Re: Access User Control value during Page_Load Victor Garcia Aprea [MVP]
6/25/2004 9:18:35 PM
Hi Cindy,

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

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
Looking for insights on ASP.NET? Read my blog:
http://obies.com/vga/blog.aspx

[quoted text, click to view]

AddThis Social Bookmark Button