Solved

web-pages use validation in helper class

Posted on 2015-02-08
1
56 Views
Last Modified: 2015-02-09
Hi.

How can I use the validation functions in a helper class?
This one gives an error. Can I import something?
It dosen´t work with: @using System.Web.Helpers.Validation

@helper create() {
      Validation.RequireField("navn", "\"Navn\" skal udfyldes");
        if (IsPost && Validation.IsValid())
      {
            Response.Write("TEST");
      }
}

I´m using c# web-pages.
0
Comment
Question by:bongii
1 Comment
 
LVL 16

Accepted Solution

by:
Easwaran Paramasivam earned 500 total points
Comment Utility
Instead you could check particular control has value or not like given below:

navn.Text == string.Empty
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now