Monday 27 January 2014

Server Side Regular Expression Validation

Server Side Regular Expression Validation

In my last article series I explained the server side Required, Range and Compare validation. In this article I am going to explain the Regular Expression Validation.

Regular Expression validation is used to validate the pattern like email address, website etc.

For Example:-


In this example I am applying the regular expression validation on name field. As I applied that it can contain only character

Server side Range and Compare validation in MVC

Server side Range and Compare validation in MVC

In my last article I discussed about the server side Required validation with example. In this example I am continuing the last topic and will cover the Range validation and compare validation in mvc.

Server Side Range Validation

To implement the range validation we have to use the Range attribute on the property in my model. As I am continuing the last article example, so our model class is Student.


So to implement the Range validation we have to set the Range attribute in the following in manner:-

Server Side Required Validation

Server Side Required Validation

In my last article series I explained some basic operation like Create, List, Edit, Detail and Delete using Scaffolding.

In my last article series I didn't explain any validation on data. As we entered the blank form it will simply entered the data.

For example:-

Perform create option but do not fill any data in controls and submit the form and then check your list

Wednesday 22 January 2014

Scaffolding Delete option using LINQ in MVC

Scaffolding Delete option using LINQ in MVC

In my last article series I explained scaffolding LIST, Create, Edit and Detail option. In this article I am going to explain Delete option.


As you see when we execute this code we will get following window where we get delete option.

Tuesday 21 January 2014

Scaffolding Detail option using LINQ in MVC

Scaffolding Detail option using LINQ in MVC

In my previous article series I explained how to use scaffolding list, create and edit option. In this article I am going to explain the edit option using scaffolding.


As we know that it is not possible for us to show all column on the screen. So we simply give link of detail and on the click of detail we show the records.

Friday 17 January 2014

Scaffolding Edit option in MVC using LINQ

Scaffolding Edit option in MVC using LINQ

Part 1:-Scaffolding LIST option using LINQ in MVC

Part 2:-Scaffolding Create Option using LINQ in MVC

In my last two articles I discussed how to use the LIST and create functionality using Scaffolding. In this article I am going to explain how to perform edit option using scaffolding.


We got following screen after performing the LIST option of scaffolding

Friday 10 January 2014

Scaffolding Create Option using LINQ in MVC

Scaffolding Create Option using LINQ in MVC

In my last article I described how to create List using Scaffolding. In this article I will discuss how to use Scaffolding Create option. If you have seen the output of LIST example code then you can see that there is link on the page for Create New.



Figure 1