There are many types of validations that do allow in MVC Models such like Required Field Validator, Data Type Validator, Range Validator and etc… But there is a way that the developer can write his own Validation Rules and work with them as a normal validator that comes built-in. This is way far easier in MVC.
Wednesday, March 7, 2012
Tuesday, March 6, 2012
ASP.NET Website Vs. Web Application Simple Comparison
Well, this looks much same as you see. In English, Website is a sort of a Web Application. But from the developer’s perspective, the Web Application project type and the Website Project Type have many differences. If you are a Visual Studio 2005 user, You will not get Web Application Project type if you have not installed Service Pack 1.
Sunday, March 4, 2012
Using MetaData Classes in MVC
A meta data class is a class that defines something that could not be done in the class in the higher level. One of the key reasons that you would need meta classes is when you are using the Entity Framework. It is useless that you modify the validation controls in the Entity Model as it will be rebuilt when you build or debug the application. So the code that you added later to validate will not be there for any more.
Wednesday, February 22, 2012
Simple JSON Example with ASP.NET MVC
JavaScript Object Notation (JSON) is highly used in today’s communication. The main reason is that it does not depend on the programming languages that you use for programming. In simple terms, a JSON object that is returned by a .NET application can be easily read by a Java Application. The only requirement is a particular URL that returns a single or many JSON objects.
Sunday, February 19, 2012
Forms Authentication in ASP.NET
ASP.NET provides you a greater set of capabilities for working with a proper authentication. This is made available with the Membership Provider in it. Membership provider provides rich set of features including adding new users and assigning them specific roles.
By default, once you create an ASP.NET Application (Not empty application), it provides the capability of registering the users and sign-in them. But, how does this work, where are these registration data are stored? As soon as you create an application, just check the folder structure by browsing it through Windows Explorer. (In Visual Studio: Right-click on Application->Open Folder in Windows Explorer) Go inside the App_Data folder and you will find nothing inside in it.
Friday, February 10, 2012
Partial Views in ASP.NET MVC 3
Generally, the coding that we type in the .cshtml or .vbhtml file in a MVC 3 view is rendered through a view engine. Before MVC 3 come into action, ASPX was the View engine used to render the content. MVC 3 introduces a new view engine named Razor. Razor is an effective rendering engine that is introduced with ASP.NET MVC 3. It has simplified syntax along with the easy and cool capabilities provided for the developer to use with. It is easy to use and will not get complicated with the syntax that was available in ASPX View engine.
A much descriptive article on Razor syntax is available at the MSDN.
Creating a Partial View is not that big thing. You just need to try adding a View by right-clicking on the sub folder under the Views folder. Then the Add View window will open. It is advised that the partial views must start with “_” prefix. It makes it easy to identify that as a partial view. Then click the checkbox in front of the Create as a partial view. Since I do have created a model class in my project, I can select it as the model. The way how Model can be modeled is described in a previous article.
Then the partial view will be created. Now it’s time to add it into a View. Just go to the view that you would like to add the partial view and type,
1
| @Html.Partial("_Index") |
Then the content in the created partial view will appear in the View where it is defined to be located. There are some minor issues when having two forms in both partial view and the View. For example adding the User and adding aProduct in the same. Lets discuss more about Partial views and the ways how it can be done in an upcoming article.
Connecting Windows Phone to Database using WCF Services
Windows Phone is a fantastic creation of the decade. The capabilities that it provides with the Mango update are really cool. One solution of a person who would need storage in Windows Phone application is either to choose the Isolated Storage or connect to an external service with a service provider like Windows Communication Foundation. If you try connecting a database to the mobile app in Android or iPhone, it will take hours for you to create the connection and get it connected. One common method in Android is to use JSON objects, which will take a lot of time.
In windows phone, it can connect with a running WCF service(may be on the web) by simply adding a service reference. This is quite simple.
Subscribe to:
Posts (Atom)