Click here to Skip to main content
15,902,189 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to apply server side validation using custom control validator, but I dont want to write a function in script tag.
I'm using inline coding.

I want to store functions in another file and want to access from that.

Please help me out.
Posted
Updated 25-Mar-11 4:35am
v2
Comments
Dalek Dave 25-Mar-11 10:35am    
Edited for Grammar and Readability.

I want to apply server side validation using custom control validator.
Do something like this
XML
<asp:CustomValidator ID="valCaptcha" runat="server" ControlToValidate="txt1"
 ErrorMessage="Your error message here" Text="*" OnServerValidate="valCaptcha_ServerValidate" ValidateEmptyText="True" />


C#
protected void valCaptcha_ServerValidate(object source, ServerValidateEventArgs args) {
           //your code to validate.
            
        }


Correct me if I understand you wrong.
 
Share this answer
 
Comments
Dalek Dave 25-Mar-11 10:36am    
Seems reasonable
where to write this code?
bcoz m creating pages at runtime.
e.g.: supppose there is a page which accepts control id and name of validations which will be perform on that. Only this is the input. No any other physical page is present. By using only this input i wanna create a new page with above controls n validations applied on them, dynamically.
Also i hv to perform server side as well as client side validations at the same time.

I thnk now you can understood my prblm...so plz help me.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900