[英]BC30451: 'MailValidation' is not declared. It may be inaccessible due to its protection level
I am using this code in my aspx file: 我在我的aspx文件中使用以下代码:
<%MailValidation(Email.Text)%>
<asp:RegularExpressionValidator runat="server" ID="RegExpValidator" CssClass="failureNotification" ControlToValidate="Email"
ValidationGroup="RegisterUserValidationGroup">*</asp:RegularExpressionValidator>
And also I have the following in my code behind: 而且我的代码后面还有以下内容:
Public Sub MailValidation(mail As String)
'Dim retVal As String
Dim s As Internet = New Internet
If mail = "" Then
RegExpValidator.ErrorMessage = Nothing
RegExpValidator.Enabled = False
GoTo endthis
End If
Dim boolVal As Boolean = IsValidEmail(mail)
RegExpValidator.Enabled = True
If Internet._error <> "True" Then
RegExpValidator.ErrorMessage = Internet._error
ElseIf Internet._error = "True" Then
RegExpValidator.ErrorMessage = Nothing
RegExpValidator.Enabled = False
End If
endthis:
End Sub
When I run the project in Debugging mode everything goes fine. 当我在“调试”模式下运行项目时,一切都会顺利进行。 But when I pass the code to the ISP server and trying to run this page throw me the error:
但是,当我将代码传递给ISP服务器并尝试运行此页面时,会抛出错误:
BC30451: 'MailValidation' is not declared. It may be inaccessible due to its protection level
Additional Update 附加更新
Looking in Client site, while I'm running from my ISP server, the aspx file don't see the code behind file at all. 在客户端站点中查看,当我从ISP服务器运行时,aspx文件根本看不到文件后面的代码。 This issue I don't have it when I'm running the project from my computer (in debugging mode).
从计算机运行项目时(在调试模式下),我没有此问题。
<asp:Content ID="LeftNav" ContentPlaceHolderID="LeftNavigationHolder" runat="server">
<div class="LeftNavDiv">
<span class="failureNotification">
<asp:Literal ID="ErrorMessage" runat="server"></asp:Literal>
</span>
<asp:Panel ID="LeftSitePanel" CssClass="LeftSitePanel" runat="server" ScrollBars="Vertical">
<asp:ValidationSummary ID="RegisterUserValidationSummary" runat="server" CssClass="failureNotification"
ValidationGroup="RegisterUserValidationGroup"/>
<fieldset class="RegisterArea">
<legend>Στοιχεία χρήστη</legend>
.........
</fieldset>
<div class="submitButton">
<asp:Button ID="SetUserButton" runat="server" CommandName="MoveNext" Text="Καταχώρηση"
ValidationGroup="RegisterUserValidationGroup" TabIndex="10" />
</div>
</asp:Panel>
</div>
</asp:Content>
I made some changes in my web.config file and the problem was solved 我在web.config文件中进行了一些更改,问题已解决
I just add lines in <assembly>
and in <namespace>
我只是在
<assembly>
和<namespace>
添加行
What is teaching this? 这是什么教导?
when we have issues between debugging mode in our computer and ISP server then the problem comes (most of the times) from the configuration file we.config. 当我们在计算机和ISP服务器的调试模式之间遇到问题时,则问题(大多数情况下)来自配置文件we.config。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.