Home All Groups Group Topic Archive Search About

object reference not set as an instance of an object

Author
31 Jan 2006 3:47 PM
jtleb
hi all,
I am new to ASP.NET  so please bear with me. i am trying to use mulitple
radio buttons on one page with a submit button. There is one radio button in
one table and 6 more in another table. When i try to get the first value it
works fine but when i try to access the value of the rest i get the following


********************************
ERROR******************************************************************
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to
an instance of an object.

Source Error:
Line 10:     Dim ProOrCon, Ans1, Ans2, Ans3, Ans4, Ans5, Ans6 As INTEGER
Line 11:     ProOrCon = PRO_CON.SelectedItem.Text
Line 12:     Ans1 = Work1.SelectedItem.Text
Line 13:     End Sub   
Line 14:     </SCRIPT>

***********************************************************************************************************
Line 12 is the error.
Please help because i am under pressure to finish this and i have been
looking for an answer for a week and i am get very frustrated.
Thanks in advance
Jtleb

Author
1 Feb 2006 4:08 PM
jtleb via DotNetMonster.com
ahh, that was easy to fix after all. sorry for bothering yeah.
Persistence pays off. i just wish i could say that about my database. God
damn normalisation
Thanks
Jtleb

jtleb wrote:
Show quoteHide quote
>hi all,
>I am new to ASP.NET  so please bear with me. i am trying to use mulitple
>radio buttons on one page with a submit button. There is one radio button in
>one table and 6 more in another table. When i try to get the first value it
>works fine but when i try to access the value of the rest i get the following
>
> ********************************
>ERROR******************************************************************
>Object reference not set to an instance of an object.
>Description: An unhandled exception occurred during the execution of the
>current web request. Please review the stack trace for more information about
>the error and where it originated in the code.
>
>Exception Details: System.NullReferenceException: Object reference not set to
>an instance of an object.
>
>Source Error:
>Line 10:     Dim ProOrCon, Ans1, Ans2, Ans3, Ans4, Ans5, Ans6 As INTEGER
>Line 11:     ProOrCon = PRO_CON.SelectedItem.Text
>Line 12:     Ans1 = Work1.SelectedItem.Text
>Line 13:     End Sub   
>Line 14:     </SCRIPT>
>
> ***********************************************************************************************************
>Line 12 is the error.
>Please help because i am under pressure to finish this and i have been
>looking for an answer for a week and i am get very frustrated.
>Thanks in advance
>Jtleb

Author
2 Feb 2006 1:59 AM
Sonu Kapoor
It looks like Work1 is not declared properly. Can you show me how you declared it?

Sonu Kapoor [MVP]
---
Posted via www.DotNetSlackers.com