Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi all,
I am trying to build a contact form using validation that i learned whilst creating standard razor webpages as below:
Validation.RequireField("captchaCheck", "Please enter your answer here.");
Validation.Add("name",
Validator.Required("Please provide your name."));
Validation.Add("email",
Validator.Required("Please provide your email address."),
Validator.Regex(@"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$",
"Invalid format for your email address."));
Validation.Add("subject",
Validator.Required("Please provide a subject for your message."));
Validation.Add("message",
Validator.Required("Please input your message."),
Validator.StringLength(4000, 0, "No more than 4000 characters."));
This is the code that sits above my contact form in an if(ispost) statement.
There is red underlines on the .required .add .isvalid after the "validation" declaration.
I cant right click and add a namespace to resolve this.
How do i solve this ?
Kind regards.
Please ignore my regex its from an old project. Trying to find a way to plug in a quick and easy contact form.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Creating A Contact Form Using SystemWeb Validation
Hi all,
I am trying to build a contact form using validation that i learned whilst creating standard razor webpages as below:
Validation.RequireField("captchaCheck", "Please enter your answer here.");
Validation.Add("name",
Validator.Required("Please provide your name."));
Validation.Add("email",
Validator.Required("Please provide your email address."),
Validator.Regex(@"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$",
"Invalid format for your email address."));
Validation.Add("subject",
Validator.Required("Please provide a subject for your message."));
Validation.Add("message",
Validator.Required("Please input your message."),
Validator.StringLength(4000, 0, "No more than 4000 characters."));
This is the code that sits above my contact form in an if(ispost) statement.
There is red underlines on the .required .add .isvalid after the "validation" declaration.
I cant right click and add a namespace to resolve this.
How do i solve this ?
Kind regards.
Please ignore my regex its from an old project. Trying to find a way to plug in a quick and easy contact form.
is working on a reply...