Link to home
Start Free TrialLog in
Avatar of andieje
andieje

asked on

how to reuse a custom validator across multiple pages

Hi
I have created a custom validator and I would like to be able to easily reuse this across pages without cutting and pasting my code. How would i do this? Here is my validator...

<asp:CustomValidator id="valCheckDelivery" runat="server" ValidationGroup="MakeRequest" Display="Dynamic" EnableClientScript="False" OnServerValidate="valCheckDelivery_ServerValidate">You have not supplied your address with your account information. Please edit your details.</asp:CustomValidator>

   Protected Sub valCheckDelivery_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs)



        args.IsValid = MyUser.UserRegisteredAddress(GetIDOfLoggedInUser())

    End Sub

thanks a lot
andrea
ASKER CERTIFIED SOLUTION
Avatar of ChadMarsh
ChadMarsh
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial