ASP.NET MVC

123
Validating Data Using Data Annotation Attributes in ASP.NET MVC
The data entered by the end user in various form fields must be validated before it is saved in the database. Developers often use validation HTML helpers provided by ASP.NET MVC to perform the input validations. Additionally, you can also use data annotation attributes from the System.ComponentModel.DataAnnotations namespace to perform validations at the model level. Data annotation attributes are attached to the properties of the model class and enforce some validation criteria. They are capable of performing validation on the server side as well as on the client side. This article discusses the basics of using these attributes in an ASP.NET MVC application.
Posted On : 20 Jun 2013
Preventing Cross Site Scripting Attacks in ASP.NET MVC 4
A website is exposed to various types of attacks and one of the most common types of attack is what is known as Cross Site Scripting (XSS). In a cross site scripting attack, malicious markup and script is entered in the web pages that are viewed by other users. If proper care is not taken to filter this malicious piece of markup, the script gets stored in the system and also rendered on web pages. Depending on the script injected by the hacker it can cause damage ranging from annoying popups to stolen credentials to accessing data stored in cookies. Therefore, it is important for ASP.NET MVC developers to prevent these types of attacks. Luckily, ASP.NET MVC offers a helping hand in safeguarding your websites. This article discusses some of the basics involved in the process.
Posted On : 06 Jun 2013
Using Cross Origin Resource Sharing (CORS) in ASP.NET Web API
For security reasons browsers prohibit AJAX calls to resources residing outside the current origin. This means you under the current settings, you can't provide a service exposed by a Web API to some other origin. However, at times you might want to allow a legitimate origin to access a resource. This is where Cross Origin Resource Sharing (CORS) specifications come into the picture. While there are other ways to enable CORS at the web application level, the ASP.NET Web API takes CORS support a step further through certain attributes. Using these attribute you can fine tune CORS at the global level, controller level or individual action level. This article discusses how this support can be used in your applications.
Posted On : 11 May 2013
Content Negotiation in Web API
Whenever you access ASP.NET Web API from your client side script (JavaScript / jQuery) by default the data is returned in JSON format. However, in certain cases you may want to retrieve the data in XML format instead of JSON. On the server side, Web API determinses what data format to use for sending data to the client by doing what is known as Content Negotiation. Simply put, content negotiation is a process by which Web API inspects the incoming request and HTTP headers accompanying the request to figure out what response format(s) the client can understand. Based on this checking Web API sends the output.
Posted On : 23 Apr 2013
Using SimpleMembership in ASP.NET MVC 4
Features such as membership and role management have been a part of ASP.NET core infrastructure since version 2.0. Developers have been using the default membership provider and role provider in their web applications. However, a common observation is that the default membership and role providers are quite rigid in terms of database schema and the way user information is stored. Luckily, SimpleMembership provides a helping hand in this area. It extends the core membership and role providers in such a way that you can use a custom database table to store user information. This article gives you step by step instructions to configure and use the SimpleMembership in ASP.NET MVC projects.
Posted On : 04 Apr 2013
Using ValidateAntiForgeryToken Attribute in ASP.NET MVC
Web applications are exposed to several security threats such as SQL injection attacks, cross-site scripting attacks and cross-site request forgery. In an attempt to assist developers protect their web applications from these attacks ASP.NET provides various techniques. To that end this article shows how an ASP.NET MVC web site can be secured from Cross Site Request Forgery (CSRF).
Posted On : 18 Mar 2013
Uploading Files Asynchronously using ASP.NET Web API
Uploading files from the client machine to the web server is a very common operation. Typically ASP.NET developers use HTML file input fields and form submission to accomplish this task. By default this file upload process is synchronous. By using Web API in combination with task-based programming, introduced in .NET 4 you can easily upload files on the server in asynchronous manner. In this article you will learn how to initiate a file upload operation using jQuery and then save the posted files on the server using asynchronous Web API.
Posted On : 09 Mar 2013
Generating Short URLs using Google URL Shortener API
At times URLs that you wish to share with others are too long to be shared in their original form. Such long URLs can affect the readability and flow of your message. Additionally, they are unsuitable to use with applications such as Twitter because of their length. Many websites, therefore, allow you to create a shorter version of a URL which gets expanded to the full original URL when accessed. This article shows how to use Google URL Shortener API to generate short URLs programmatically.
Posted On : 04 Mar 2013
Introduction to Single Page Applications in ASP.NET MVC
ASP.NET MVC 4 Beta introduced Single Page Applications (SPA), web applications that provide rich functionality to a web page through client side scripting. As of this writing support is limited, but it does provide a basic framework for building data driven web pages using popular JavaScript libraries. This article discusses the SPA project template and parts of a typical SPA application.
Posted On : 04 Oct 2012
Incorporating Markup Dynamically Using Child Action Methods
In a typical ASP.NET MVC application, the controller sends model data to the view and the view then renders the data in the required form. In some cases, however, the view needs to display model data in different ways depending on some condition. This task can be done in the view itself or can be isolated in what is known as child action method. This article shows how child action methods can be used to render markup dynamically.
Posted On : 24 Sep 2012
123


Copyright (C) bipinjoshi.net. All rights reserved.
Contact Us
Read Copyright & Terms Of Use
Hosted By DiscountASP.net