简体   繁体   English

错误 BC30456:“文本”不是“System.Web.UI.Control”的成员

[英]Error BC30456: 'text' is not a member of 'System.Web.UI.Control'

I need to move website from remote server to local IIS (Windows 7 Enterprise).我需要将网站从远程服务器移动到本地 IIS (Windows 7 Enterprise)。 Everything works except some links, error message:一切正常,除了一些链接,错误信息:

Compiler Error Message: BC30456: 'text' is not a member of 'System.Web.UI.Control'.

Source:来源:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Dim data1 = FormView1.FindControl("label18")
    Dim data2 = FormView1.FindControl("label19")
    Dim data3 = FormView1.FindControl("label20")
    Dim data4 = FormView1.FindControl("label21")
    Dim data5 = FormView1.FindControl("label22")
    data1.text = Session("rok")

Last line is highlighted in error message.最后一行在错误消息中突出显示。

When I use "View in Browser" in Visual Web Developer 2008 everything works.当我在 Visual Web Developer 2008 中使用“在浏览器中查看”时,一切正常。 What I need to run this site with no errors on IIS?我需要什么才能在 IIS 上正常运行此站点?

Convert it to a label then you have access to the Text property. 将其转换为标签,然后您就可以访问Text属性。

Dim data1 = TryCast(FormView1.FindControl("label18"), Label)
If Not data1 Is Nothing Then data1.Text = Session("rok")

data1 = Nothing if it does not convert. 数据1 = Nothing ,如果不转换。

Dim data1 = CType(FormView1.FindControl("label18"), Label).text= Session("rok")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误 BC30456:“VisualBasic”不是“Microsoft”的成员 - error BC30456: 'VisualBasic' is not a member of 'Microsoft' 错误BC30456“表单”不是“ Windows”的成员 - Error BC30456 'Form' is not a member of 'Windows' 错误BC30456:“ ElementAtOrDefault”不是“ System.Data.EnumerableRowCollection(Of System.Data.DataRow)”的成员 - Error BC30456: 'ElementAtOrDefault' is not a member of 'System.Data.EnumerableRowCollection(Of System.Data.DataRow)' 错误代码:BC30456'idno'不是'IEnumerable(Of pt)'的成员 - Error code: BC30456 'idno' is not a member of 'IEnumerable(Of pt)' Visual Basic错误BC30456'红色不是'颜色'的成员 - Visual Basic error BC30456 'RED is not a member of 'COLOR' 错误BC30456:'[方法]'不是'ASP。[CodeBehind] _aspx'的成员 - error BC30456: '[Method]' is not a member of 'ASP.[CodeBehind]_aspx' bc30456错误…xxxx不是yyyy的成员 - bc30456 errors… xxxx not a member of yyyy backcolor不是asp.net中system.web.ui.control的成员 - backcolor is not a member of system.web.ui.control in asp.net Visual Basic 错误 BC30456 'Form1' 不是 'WindowsApplication1' 的成员 - visual basic error BC30456 'Form1' is not a member of 'WindowsApplication1' BC30456:'bindData'不是'shoppingCart1.ShoppingCart'的成员 - BC30456: 'bindData' is not a member of 'shoppingCart1.ShoppingCart'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM