I'm creating a edit view inwhich a user can create a article/document. In this edit view there are some fields that are required, but I can't see where you define that a field is required.

For example in a TextField, if this TextField has to be filled in how can you check that it is when the page is saved?




You could use the standard ASP.NET Validation Controls like the <asp:RequiredFieldValidator /> control.

<asp:TextBox ID="foo" runat="server"/>
<asp:RequiredFieldValidator ID="fooValidator" ControlToValidate="foo" 
     Text="Field foo is required." runat="server"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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