Category: ASP.NET

15 Best ASP.NET based Content Management Systems(CMS)

ASP.NET is a Web Application development framework thats lets the developers to build dynamic web applications using .NET. In this article , we share 15 cool ASP.NET MVC based CMS (Content Management Systems) that you might find it useful. 15 Best ASP.NET based Content Management Systems(CMS) Orchard Progress Sitefinity Composite C1 Kentico CMS for ASP.NET DotNetNuke: CMS Content Management MojoPortal CMS  Kooboo CMS  Umbraco  Yendo…

How to add a Controller in ASP.NET MVC Application ?

Controller is one of the main component in the MVC Architecture. When the user enters the URL , the requests are first handled by the controllers which then identifies the right view to be rendered. The controllers class is inherited from System.Web.Mvc.Controller class and it contains various action methods. How to add a Controller in ASP.NET MVC Application ? To add the controller in ASP.NET…

How to read a connection string from web.config file in ASP.NET ?

Assume that you have a connectionstring configured in the web.config file of your ASP.NET application and you wish to read it using C# within your application. How to read a connection string from web.config file in ASP.NET ? You can easily do that using the ConfigurationManager class defined in the System.Configuration namespace. 1. Ensure that the System.Configuration assembly is referenced in your project. 2. Add…

How to create RadioButton in ASP.NET MVC ?

The ASP.NET MVC Framework provides the helper method RadioButton and RadioButtonFor to create radio button in ASP.NET MVC web page. How to create RadioButton in ASP.NET MVC ? Below is a sample sourecode snippet demonstrating how to create RadioButton in ASP.NET MVC . View @model MvcApplication1.Models.EmployeeVM @{ ViewBag.Title = “Index”; } <h2>@ViewBag.ApplicationTitle</h2> @Html.Label(“AbundantCode-a Programming Directory”) @Html.RadioButtonFor(Model => Model.IsActive, true) @Html.RadioButtonFor(Model => Model.IsActive, false)

ASP.NET MVC and View State

The ASP.NET Web Forms includes the Server Controls which generally retains the state of the controls in the hidden field called _ViewState . Does ASP.NET MVC have View State ? The concept of server controls in ASP.NET Web Forms is different from the ASP.NET MVC . The ASP.NET MVC does not maintain the _ViewState in the HTML pages that is rendered by Razor or ASPX…

What are the Advantages of the ASP.NET MVC Framework ?

ASP.NET MVC has some advantages over the traditional ASP.NET Web Forms development . In this article , we will have a look at some of the advantages of the ASP.NET MVC Framework . What are the Advantages of the ASP.NET MVC Framework ? SoC – Separation of Concerns Separation of Concern is one of the core advantages of ASP.NET MVC . The MVC framework provides…

Using MapRoute for Registering Routes in ASP.NET MVC 4

The previous article explained How to Create and Register a Route in ASP.NET MVC using the Route class and add it to the RouteCollection. This article will explain how to use MapRoute class for registering routes in ASP.NET MVC 4. Using MapRoute for Registering Routes in ASP.NET MVC 4 The MapRoute is defined in the RouteCollection and can be used without creating the instance of…

How to refresh the HTML Webpage every few seconds automatically using Meta tags?

There may be a scenario where the developer might want to auto refresh the HTML webpage every few seconds automatically. To auto refresh code in html, one can add the metatag with the http-equip=”refresh” and content attribute. The tag http-equiv should be set to “refresh”, the content attribute of the meta tag should be set to the time limit for refresh. How to refresh the…

What is the difference between RouteLink and ActionLink in ASP.NET MVC ?

This article will cover some of the key differences between the RouteLink and ActionLink helper methods in ASP.NET MVC. What is the difference between RouteLink and ActionLink in ASP.NET MVC ? The Html.ActionLink renders the hyperlink tag to the specified controller action which uses the Routing API internally to generate URL. This renders the Anchor tag that links to the action method. The ActionLink method…

How to return Http Status Code from ASP.NET Web API Controller ?

There are times when you might want to return the Http Status code from an action method of a ASP.NET Web Api Controller. One of the simplest way of doing this is using the CreateResponse method of the HttpRequestMessage as shown below. The sample below demonstrates how to return the status code 304 and 200 based on the last modified date of the employee record….

Creating Areas in ASP.NET MVC Application

The ASP.NET MVC Framework has the concept of “Areas” which allows the developers to organize the functional module of the web application. For Example, the modules like administration, student’s data, exam/test, results can be each area in the Application. The Area in the ASP.NET MVC project has a folder structure which includes controllers, views, Models etc. and allows the developers to keep them separate from…

IoC Frameworks for ASP.NET Developers

In the previous article , an introduction to the Dependency Injection and IoC frameworks was provided . In this article , let’s see the different IoC Frameworks available for ASP.NET Developers. IoC Frameworks for ASP.NET Developers Below are just links to some of the popular IoC frameworks . Autofac Spring.NET Microsoft Unity Structure Map Castle Windsor Ninject

No parameterless constructor defined for this object error in ASP.NET MVC Project

If you are getting an error similar to the one shown below in your ASP.NET MVC Project , you could verify your Model. No parameterless constructor defined for this object error in ASP.NET MVC Project Server Error in ‘/’ Application. No parameterless constructor defined for this object. An unhandled exception occurred during the execution of the current web request. Please review the stack trace for…

How to display a View from different controller in ASP.NET MVC 4 ?

Sometimes , it might be required to display a view from a different controller when developing website using ASP.NET MVC . How to display a View from different controller in ASP.NET MVC 4 ? This can be achieved by simply passing the view name along with the controller name to the return type of ActionResult like the wasy shown below. In the above example ,…

DotnetOpenAuth – OpenId API for ASP.NET MVC Application

DotnetOpenAuth is a open source library that allows the developers to add the OpenId and OAuth capabilities to their ASP.NET Web Application. It allows the developers to include the OpenId support by just dragging and dropping a ASP.NET control to the Web Page. The DotnetOpenAuth has a classic ASP support and also support for custom extensions. Know more about DotnetOpenAuth – OpenId API for ASP.NET…

Files and Folders in ASP.NET MVC 4 Project

Below are some of the files and folders that are created by default when creating a new ASP.NET MVC Project. App_Data – The developers can add the databases like SQLite or SQL Server Express database file or XML files to this folder App_Start – This contains the core settings of the ASP.NET MVC Project. Content – Contains contents like CSS file and images. Controllers –…