does not contain a definition for 'PolicyValidate' and no extension method 'PolicyValidate'

  • Follow


in the .ASPX i have 
<td>
                      <asp:Panel ID="Panel1"
DefaultButton="btnNewPolicy" runat="server">
                        <asp:TextBox ID="textPolicyNumber"
runat="server" MaxLength="10" /><br />
                        <asp:Button ID="btnNewPolicy" runat="server"
Text="Get Forms" OnClick="lnkNewPolicy_Click"
                          Visible="true" /><br/>
                        <asp:CustomValidator ID="PolicyNumberValidator"
runat = "server"
                                 OnServerValidate="PolicyValidate"
ControlToValidate="textPolicyNumber"
                                  Display="Dynamic" ErrorMessage="not
right" ></asp:CustomValidator>
                        <asp:Label ID="lblPolicyMessage" runat="server"
Font-Bold="true" ForeColor="Red"
                          Visible="true" Text="" />
                      </asp:Panel>
                    </td>

in the ASPX.CS i have

protected void PolicyValidate(object sender, ServerValidateEventArgs
args)
    {
        args.IsValid = ((args.Value.ToString().Trim().Length == 0)
||(args.Value.ToString().Trim().Length == 10));
    }

and i keep getting the CS1061: 'ASP.policyholder_reportclaim_aspx' does
not contain a definition for 'PolicyValidate' and no extension method
'PolicyValidate' accepting a first argument of type
'ASP.policyholder_reportclaim_aspx' could be found (are you missing a
using directive or an assembly reference?)

error message.  what did i do wrong?

thanks 


Woody
any sugestion or comment made by me should be examined first for
validity and appropriateness before assuming i  have any idea at all
what the heck i am talking about.  I am not responsible for anything you
may see with my name attached to it, i think.

*** Sent via Developersdex http://www.developersdex.com ***
0
Reply Woody 4/12/2010 11:32:29 PM


0 Replies
260 Views

(page loaded in 0.043 seconds)


Reply: