I am using this code in my aspx file:
<%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:
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. 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>
<assembly>
nor<namespace>
in my Web.config file. – Motorcycle