473,395 Members | 2,689 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# -assigning value to a user control during Page_PreRender

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
--
Cindy X
Jul 21 '05 #1
0 4285

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nemo | last post by:
I have problem to get my dates from my user control. The problems is that the datetimes sets after when I get the values from my aspx page. Here is how my user control lock likes. private...
1
by: Anthony Knittel | last post by:
i've got an expensive loop that keeps running for a long time, whats the best way to put breaks in the program to return a bit of control to the user instead of locking up the system? its just a...
7
by: Chuck | last post by:
I am working in C# 2003. Can anyone tell me how to make a user control transparent. VS help doesn't help. What I want to do is draw on a user control during design time and then place the...
1
by: Chris | last post by:
novice question here... I am building a registration form while learning Asp.Net. I am having trouble passing data between "dynamically"-added server controls. To simplify, I have a single...
3
by: Cindy | last post by:
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...
2
by: John Ninan | last post by:
I am creating Dynamic Usercontrol in Asp.net application. In this application I have a combobox(aspx Page). Which contains various items. Based on item selected I am dynamically populating...
3
by: JJ_377 | last post by:
I made a user control to gather usa address information and would like to know why the following doesn't work (I am assigning the valid of textbox in a second instance of the control from the first...
0
by: Cindy X | last post by:
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...
7
by: Christian Cambier | last post by:
Hi, I have a textbox in a web user control. I then add the usercontrol to a web form. I also add a label in the web form. Now, when I press a key in the textbox, i want to display some text...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.