Groups | Blog | Home
all groups > asp.net webcontrols > january 2006 >

asp.net webcontrols : object reference not set as an instance of an object


jtleb
1/31/2006 3:47:33 PM
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 via DotNetMonster.com
2/1/2006 4:08:56 PM
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

[quoted text, click to view]

--
Message posted via DotNetMonster.com
Sonu Kapoor
2/1/2006 5:59:47 PM
It looks like Work1 is not declared properly. Can you show me how you declared it?

Sonu Kapoor [MVP]
---
AddThis Social Bookmark Button