Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have developed a small form with 3 input type = text and one input type = submit button. The end user fills the form and submit it, but no data inserted into backend List. (probably empty form is submitted). I get to know that Javascript is disabled on user's browser. Now i want to do server side validation. How i validate my form on server side? I need a piece of code to validate form on server side (code behinde) ? I need code in asp.net

share|improve this question
2  
How is this related to SharePoint? Are you referring to a List form or Application page, Web part?? –  C. Marius - MVP Jan 12 '13 at 19:02
    
yes, i am using SP list for storing data and i am working on application page –  SPBeginer Jan 13 '13 at 11:49
add comment

1 Answer 1

up vote 1 down vote accepted

In your button click method try calling

Page.Validate()

//OR

Page.Validate("[Name of validation group]") 

and then:

if(Page.IsValid) {
    //Go ahead and submit your data to SharePoint.
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.