VB不喜欢我的ASP控件名称 [英] VB does not like my ASP control names

查看:84
本文介绍了VB不喜欢我的ASP控件名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的TB,RB和DDL都用蓝色下划线!该错误完全没有意义,因为我没有对任何控件应用保护级别.打扰一下,但是我现在 F *** ING 真烦死了!我的任何一个同学都不知道有什么问题. :(我的代码都很好.我应该早就完成这项任务的!请帮忙!

错误:未声明"RB_Standard".由于其保护级别,可能无法访问."

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."

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

推荐答案

这听起来像是一个愚蠢的问题,但是您的文本框在属性列表中是否包含runat="server"?如果没有,则后面的代码将无法访问它们.

如果您使用的是MasterPage并且控件位于此处,则可能同样如此.除非您说应该这样做,否则它们也将无法在母版页之外访问.

抱歉,但是由于我们所掌握的信息有限,所以我不能再具体了.
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.


aspx中的代码不在同一类中,因为所需的值不是'没有公开,因此您根本无法访问它们.检查链接以获取有关此内容的更多信息:

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

祝你好运!
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!


这篇关于VB不喜欢我的ASP控件名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆