Skip to main content

Posts

Showing posts with the label asp net mvc 6 architecture

Where the Routing rules are defined in an ASP.Net MVC Application?

Where the routing rules are defined in an ASP.Net MVC Application? In Application_Start event in Global.asax The example looks like, public class MvcApplication : System . Web . HttpApplication {     protected void Application_Start ()     {         GlobalConfiguration . Configure ( WebApiConfig . Register );         FilterConfig . RegisterGlobalFilters ( GlobalFilters . Filters );         RouteConfig . RegisterRoutes ( RouteTable . Routes );         BundleConfig . RegisterBundles ( BundleTable . Bundles );     } }

What Are the benefits of using MVC?

The MVC is a framework, standard pattern for developing Web applications and MVC framework handled by three objects Model, View and Controller. The Benefits of MVC - It makes it easier to manage complexity by dividing an application into the model, the view, and the controller. Easy to maintain the applications It provides better support for test-driven development (TDD). It does not use view state or server-based forms.

What Is MVC (Model View Controller)?

MVC stands for Model View Controller . The ASP.NET MVC is a framework, standard pattern for developing Web applications. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating Web applications. The ASP.NET MVC framework handled by three objects Model, View and Controller. The MVC framework includes the following components - 1.       Model – Model contains the business logic which is used to retrieve and store model state in a database. Model is a central parts and works between View and Controller. 2.       View – View is a user interfaces ( UI ), look and feel which are used to display the application's user interface ( UI ). 3.       Controller – Controller are components that handles and responds to user input and interactions. The ASP.NET MVC framework is a lightweight, highly testable presentation framework. The MVC framework is d...

How To Allow HtmlAttribute in ASP.NET MVC 5? Why Use?

The  AllowHtml  attribute is used to allow a request to sending  HTML/JavaScript  codes to server which be applied to a Model property to disable the validation. The  AllowHtml  attribute is developed for  View Model class  with  limited Scope  and its safe and recommended solution to prevent Cross Site Scripting ( XSS ) attacks in ASP.NET  MVC  Apps. In ASP.Net MVC Project, follow the below steps and prevent the XSS Attacks - //Steps 1 //Add the following attribute the post action in the controller that you want to allow HTML. [ ValidateInput ( false )] //Steps 2 //AllowHtml attribute is developed for Customer View Model class. public   class   CustomerViewModel {     [ Display (Name =  "Email" )]      public   string  Email {  get ;  set ; }     [ AllowHtml ]      public   string ...