Good Morning All,
How can i get a handle on this drop down list?
public void myDropDown_OnDataBinding(object sender, EventArgs e)
{
DropDownList myDropDown = (DropDownList)sender;
Debug.Write(myDropDown.SelectedItem.Value);
}
gives me an Exception Details: System.NullReferenceException: Object
reference not set to an instance of an object.
Any ideas?
Thanks,
Chris 3 930
Apparently no item is selected, thus raising the NullRefernceException.
--
I hope this helps,
Steve C. Orr, MCSD, MVP http://SteveOrr.net
"Chris Kettenbach" <c_**********@hotmail.com> wrote in message
news:0o********************@giganews.com... Good Morning All, How can i get a handle on this drop down list? public void myDropDown_OnDataBinding(object sender, EventArgs e) { DropDownList myDropDown = (DropDownList)sender; Debug.Write(myDropDown.SelectedItem.Value); }
gives me an Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Any ideas?
Thanks, Chris
Likely myDropDown.SelectedItem is null?
"Chris Kettenbach" <c_**********@hotmail.com> wrote in message
news:0o********************@giganews.com...
Good Morning All,
How can i get a handle on this drop down list?
public void myDropDown_OnDataBinding(object sender, EventArgs e)
{
DropDownList myDropDown = (DropDownList)sender;
Debug.Write(myDropDown.SelectedItem.Value);
}
gives me an Exception Details: System.NullReferenceException: Object
reference not set to an instance of an object.
Any ideas?
Thanks,
Chris
it could be that the SelectedItem object is what raising the null exception..
DropDownList myDropDown = (DropDownList)sender; should be working..
by the way,
"Chris Kettenbach" wrote: Good Morning All, How can i get a handle on this drop down list? public void myDropDown_OnDataBinding(object sender, EventArgs e) { DropDownList myDropDown = (DropDownList)sender; Debug.Write(myDropDown.SelectedItem.Value); }
gives me an Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.
Any ideas?
Thanks, Chris This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tony Johansson |
last post by:
Hello!!
Assume I have a handle body pattern with classes called Handle and Body.
In the Body class I store one int value for example 7 or some other integer
value.
In the Handle class I have...
|
by: Indiana Epilepsy and Child Neurology |
last post by:
Before asking this questions I've spent literally _years_ reading
(Meyer, Stroustrup, Holub), googling, asking more general design
questions, and just plain thinking about it. I am truly unable to...
|
by: weaknessforcats |
last post by:
Handle Classes
Handle classes, also called Envelope or Cheshire Cat classes, are part of the Bridge design pattern. The objective of the Bridge pattern is to separate the abstraction from the...
|
by: ndhoan19 |
last post by:
I have two dropdowlist. dropdowlist1 and dropdowlist2. dropdowlist2 get data of dropdowlist1 .Example. data of dropdowlist2 is
English
Span
Japan
Other
Now. I want to English, Span,Japan not...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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,...
|
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...
|
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...
| |