Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jan 03, 2013 07:36 AM by Catherine Shan - MSFT
Dec 29, 2012 08:58 PM|LINK
I am getting the error 'CS1061: 'ASP.account_login_aspx' does not contain a definition for 'ServerValidation' and no extension method 'ServerValidation' accepting a first...'
I added a CustomValidation control on the login.aspx sample supplied with VC2010. My exact code is:
<asp:CustomValidator id="UserAlreadyLoggedIn" runat="server" ControlToValidate="UserName" CssClass="failureNotification" Display="Static"
ErrorMessage="That user ID is already connected" OnServerValidate="ServerValidation" ValidationGroup="LoginUserValidationGroup"></asp:CustomValidator>
In the code behind I have:
void ServerValidation(object source, ServerValidateEventArgs arguments)
so the function is defined. I don't understand why it is not found.
Any help appreciated.
Dec 29, 2012 09:18 PM|LINK
achalk: Your head is much smaller than previously believed. Declaring a function without a visibility modifier means that it defaults to 'private':
change it to:
Jan 03, 2013 07:36 AM|LINK
Very glad to hear that you have resolved your issue and thank you for sharing your solution.