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
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