简体   繁体   English

BC30451:未声明'MailValidation'。 由于其保护级别,它可能无法访问

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

相关问题 BC30451:未声明&#39;NewsBody&#39;。 由于其保护级别,它可能无法访问 - BC30451: 'NewsBody' is not declared. It may be inaccessible due to its protection level 未声明下拉列表。 由于其保护级别,它可能无法访问 - dropdownlist is not declared. It may be inaccessible due to its protection level 未声明控制权。 由于其保护级别,它可能无法访问 - Control is not declared. It may be inaccessible due to its protection level &#39;ViewBag&#39;未声明。 由于其保护级别,它可能无法访问 - 'ViewBag' is not declared. It may be inaccessible due to its protection level 'txtName' 未声明。 由于其保护级别,它可能无法访问 - 'txtName' is not declared. It may be inaccessible due to its protection level 未声明“ ZoneDropDown”。 由于其保护级别,它可能无法访问 - 'ZoneDropDown' is not declared. It may be inaccessible due to its protection level (VB.NET)未声明“ VB6”。 由于其保护级别,它可能无法访问 - (VB.NET) 'VB6' is not declared. It may be inaccessible due to its protection level 添加的asp控件给出错误&#39;未声明。 由于其保护级别,它可能无法访问。 - added asp control gives error 'is not declared. It may be inaccessible due to its protection level.' Asp.net成员资格配置文件的名字和姓氏(未声明。由于其保护级别,可能无法访问) - Asp.net Membership Profile FirstName and LastName (Not declared. It may be inaccessible due to its protection level ) 我收到“未声明&#39;Eval&#39;。 由于它的保护级别,它可能无法访问。 - I'm getting “'Eval' is not declared. It may be inaccessible due to its protection level” in a ascx
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM