嘿,我想得到这个:
<div id="subpg_main">
<%= theHeadering %>
</div>
<!-- END BODY PAGE ------------------------->
在我的 HTML 代码中工作。
后面的代码只有这个:
Public Class thankyou
Inherits System.Web.UI.Page
Public theHeadering As String = ""
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim theName As String = "Bob Barker"
Dim theEmail As String = "bobb@thepriceisright.com"
If theForm = "contact" Then
theHeadering = "<H1>Thank you " & theName & " for contacting us!</H1><BR />"
theHeadering += "We will be contacting you via your email address at " & theEmail & " within 24 hours."
End If
End Sub
End Class
但是,当我运行该页面时,出现以下错误:
编译器错误消息:BC30451:未声明“theHeadering”。由于其保护级别,它可能无法访问。