[英]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.