我正在尝试在我的 aspx 页面中显示在我的代码后面声明的公共字符串“TrialExtensionLengthDays”:
<asp:Button ID="ExtendTrialButton" runat="server" Text="Extend Trial" CssClass="actionButton extendTrialButton" title="Extend Trial by <%=TrialExtensionLengthDays%> days" OnClientClick="confirm('Extend the Customer Demo by <%=TrialExtensionLengthDays%> days?')"/>
这是后面代码的相关部分:
Public Class EditTrialCustomer
Inherits System.Web.UI.Page
Public TrialExtensionLengthDays As String
Protected Sub Page_OnPreInit()
TrialExtensionLengthDays = (System.Configuration.ConfigurationManager.AppSettings("TrialExtensionLengthDays"))
End Sub
为什么它不起作用?