Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jul 10, 2012 09:42 AM by Mudasir.Khan
Jul 10, 2012 09:13 AM|LINK
i'm very newbie of mvc application,i have small doubts in this
1. i have to validate the attachement size is below 2 MB and file extension like .txt and .doc file only(have to validate while attaching)
2. how to validate my text area text length shouldn't more than 300 letters.(if user type more than 300 letters i have to raise error)
i dont know where to write the validation also.
please help me out..
Jul 10, 2012 09:42 AM|LINK
if (FileUpload1.PostedFile.ContentLength > 0)
//ContentLength returns the size in bytes
if(FileUpload1.PostedFile.FileName.EndsWith(".txt") || FileUpload1.PostedFile.FileName.EndsWith(".doc"))
//display error message