JScript for the .NET Framework


how to do validation in cshtml (MVC)


Hi,
I have created one form in cshtml.
I need to validate some fields in the form.(like name, postal code, phone number)
Can anyone pls tell me how to do this? can we do it using javascript?
Hi karthiga,
You can get all your concerns on MVC View Model validation settled after learning this wonderful blog(tutorial): Some new features of MVC2 enforces validation logic on models/viewmodels significantly easier. These features are designed so that the
validation logic is always enforced on the server, and can optionally also be enforced on the client via JavaScript.
ASP.NET MVC 2: Model Validation: http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx.
I am afraid this forum is not what you want, what you wanna is the official MVC Forum here: http://forums.asp.net/1146.aspx/1?MVC.
If the provided links could not fulfill your requirement, please close this thread and create a new one there in that forum to get dedicated support.
Thanks for your understanding.
Have a nice day, Leo Liu [MSFT]
MSDN Community Support | Feedback to us

Related Links

Drag and Drop Images from a Toolbox using javascript
Microsoft jScript runtime error
how to make a screen Like this?
Not Understand javascript code compatible with IE
how to find a texbox control inside a datagrid using javascript
ajax controls similar to office on web application
Create new HTML Helper for Search button
IE7 showmodaldialog displays unnecessary scroll bar with content
Javascript client server download speed help
Help i am getting this error 'Runtime error: unable to load dll jscript." can anybody help?
scrollbar in asp ListBox control
De-serialize Json in WPF
column resizing with repeater control
take snapshot of google map on javascript button click
Change ImageURL with JScript
document.getElementById().innerHTML fails with 'Unknown Error' in IE

Categories

MSDN
Apps for Office and Sh...
.NET Framework
Visual Studio Design a...
Visual FoxPro
Commerce Server
Windows Forms
Feedback and Discussions
Windows Hardware Devel...
Bing Maps
Archived Forums #
Archived Forums I-L
Announcements for all ...
MSDN and TechNet Profi...
Visual Studio Editor
Developing Universal W...
App & Ad Unit Management
Media Foundation Devel...
Application Security f...
Windows Hardware Testi...
SharePoint 2010 - Gene...
SharePoint 2010 - Deve...
SharePoint Legacy Vers...
Cloud Services (Web an...
Azure Management Portal
Azure HDInsight
Azure Log Analytics
Azure Service Fabric
Azure IoT Hub
Azure Disk Encryption
Azure Analysis Services
Azure Log Integration
Team Foundation Server...
Team Foundation Server...
WCF Data Services
ADO.NET DataSet
XML, System.Xml, MSXML...
JScript Native
Microsoft Translator D...
Microsoft Translator U...
Small Basic
SyncFx - SyncToy-File ...
Microsoft Robotics - H...
Visual Studio Smart De...
SQL Server Data Access
Getting started with S...
Database Mirroring
Standard 2009: Misc
SQL Server 2012 Setup ...
SQL Server 2012 High A...
Windows Server 2008 Ap...
CRM
MSDN, TechNet and Expr...
Speech Service for Dev...
Bing Maps General
Open Specifications Qu...
Exchange Server Protocols
Project Server General...
Bing Ads API: Development
Silverlight 4
Programming Silverligh...
Visual Studio & Silver...
Expression Studio with...
Reference Source Serve...
Core Coding Experience...
Chart Controls for .NE...
Game Technologies: XNA...
HD DVD Interactivity A...
Monitor, Alert and Aut...
Network Class Library ...
patterns & practices: ...
POS for .NET
Service Bus EAI & EDI ...
SQL Server 2014 In Azu...
Team Foundation Server...
Tools for Windows Phon...
Tools for Windows Stor...
Tailoring your Windows...
Visual Studio LightSwi...
Windows MultiPoint Mou...
Mango Update (Archived)
Windows Phone Preview SDK

Resources

Encrypt Message



code
soft
python
ios
c
html
jquery
cloud
mobile