vbnetrookie
Member
- Joined
- May 30, 2005
- Messages
- 5
- Programming Experience
- Beginner
Hello dear developpers!!
I'm building a web app(form) in which I have 2 radiobuttonlist, the
second one only appears when a certain item is selected from the first
one. And afterwards, I send the selected item as a string and into a
database table. This works fine when the second radiobuttonlist appears
and an option is selected. The problem arises when the second
rbl(radiobuttonlist) doesn't appear because the specific item wasn't
selected, (which is alrigh) but when I click my submit button...I get
an error saying :
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
So I would like to assign a value by default to the second rbl
something like Null...
I tried RadioButtonList2.Items.Add("Null")
but it still gives me the error, and i guess it's 'cause that item
isn't really selected...it's just added to the list...
does anyone know a way of assigning a value by default to a component
that isn't even visible on the page at that time ???
Thanks for the help guys!!!
JMT
I'm building a web app(form) in which I have 2 radiobuttonlist, the
second one only appears when a certain item is selected from the first
one. And afterwards, I send the selected item as a string and into a
database table. This works fine when the second radiobuttonlist appears
and an option is selected. The problem arises when the second
rbl(radiobuttonlist) doesn't appear because the specific item wasn't
selected, (which is alrigh) but when I click my submit button...I get
an error saying :
Exception Details: System.NullReferenceException: Object reference not
set to an instance of an object.
So I would like to assign a value by default to the second rbl
something like Null...
I tried RadioButtonList2.Items.Add("Null")
but it still gives me the error, and i guess it's 'cause that item
isn't really selected...it's just added to the list...
does anyone know a way of assigning a value by default to a component
that isn't even visible on the page at that time ???
Thanks for the help guys!!!
JMT