Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
All of my TB's, RB's, and DDL's are underlined in blue! The error makes absolutely no sense because I did not apply a protection level to any of the controls. Excuse my language, but I am so F***ING annoyed right now! None of my classmates have any idea what's wrong, either. :( My code is all good. I should have had this assignment done a long time ago! Please help!

"Error: 'RB_Standard' is not declared. It may be inaccessible due to its protection level."

VB
strName = TB_Name.Text
strEmail = TB_Email.Text
strArrivalDate = TB_ArrivalDate.Text
strDepartureDate = TB_Departure.Text
intAdultsNum = CInt(DDL_Adults.Text)
intChildNum = CInt(DDL_Children.Text)
strRequests = TB_Requests.Text

If RB_Business.Checked Then
    strRoomType = RB_Business.Text
ElseIf RB_Suite.Checked Then
    strRoomType = RB_Suite.Text
Else
    strRoomType = RB_Standard
End If
Posted
Comments
André Kraak 13-Oct-11 15:15pm    
Please post the code where the variables are declared.

This may sound like a stupid question, but do your text boxes have runat="server" in the attributes list? If they don't, then they are not accessible to the code behind.

The same can be true if you are using a MasterPage and the controls are located there. Unless you have said they should be, they will not be accessible outside the master page either.

Sorry, but from the limited information we have, I can't be any more specific.
 
Share this answer
 
The code in the aspx is not in the same class and because the values you want aren't exposed and therefore you simply can't access them. Check the link for more info on this:

http://msdn.microsoft.com/en-us/library/43s90322%28v=VS.80%29.aspx[^]

Good luck!
 
Share this answer
 
Comments
Blind.Geek81 13-Oct-11 16:48pm    
OK, now I feel a little dumb :) When I created the project, I must have modified and renamed the default "About.aspx" because it was trying to inherit the About page. Oh well; sometimes the simplest things can turn nice clean code into the biggest messes. :) Thanks alot. :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900