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>
achalk
Member
68 Points
105 Posts
Cannot add CustomValidator to login.aspx
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:
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.
Thanks.
achalk
Member
68 Points
105 Posts
Re: Cannot add CustomValidator to login.aspx
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':
void ...
change it to:
protected void...
Catherine Sh...
All-Star
23382 Points
2490 Posts
Microsoft
Re: Cannot add CustomValidator to login.aspx
Jan 03, 2013 07:36 AM|LINK
Hi,
Very glad to hear that you have resolved your issue and thank you for sharing your solution.
Best wishes,
Feedback to us
Develop and promote your apps in Windows Store