|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
object reference not set as an instance of an objectI 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 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 -- Message posted via DotNetMonster.com http://www.dotnetmonster.com/Uwe/Forums.aspx/asp-net-web-controls/200602/1 It looks like Work1 is not declared properly. Can you show me how you declared it?
Sonu Kapoor [MVP] --- Posted via www.DotNetSlackers.com
Error: Content is not allowed between the opening and closing tags for element
Invalid FORMATETC structure (Exception from HRESULT: 0x80040064(DV_E_FORMATETC)) Date masked textbox for user input Menu displays I-Beam cursor, not Hand GridViewUpdateEventArgs not including complete set of OldValues and NewValues How to Catch exception for GridView control? DropDownList resets selectedIndex on postback Strange behavior with gridview and selectedindex Need Help: AccessDataSource and Assigning Variables for Data (ASP 2.0) Communicating between windows control and web page |
|||||||||||||||||||||||