Tag: 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 read connection string from web.config in ASP.NET and C# ?

Here’s a sample code snippet demonstrating how to get the connection string from your ASP.NET web.config file so that you can make a connection to the database. How to read connection string from web.config in ASP.NET and C# ? Assume that the connection string name defined in the web.config file is “conn1” , you would get the connection string using the ConnectionManager class.

How to return Json instead of XML in ASP.NET Web API ?

When you make a call to the ASP.NET Web API action method and notice this in Google Chrome browser , you would see that by default the data would be displayed in the XML format as shown in the screenshot. How to return Json instead of XML in ASP.NET Web API ? You can easily change this behavior by adding the following code in the…

How to Add Web API to existing ASP.NET Web Forms Project ?

In one of the previous posts , we saw how to add the WebAPI to the existing ASP.NET MVC project. Well , the process of adding the ASP.NET Web API to the existing ASP.NET Web Forms project is still the same. You can easily do that by installing it from NuGet. Open the Package Console Manager in Visual Studio 2015 and run the following command….

How to Add Web API to existing ASP.NET MVC Project ?

There are times when you might want to add Web API project to one of your existing ASP.NET MVC project instead of creating a new one. How to Add Web API to existing ASP.NET MVC Project ? You can easily do that by installing it from NuGet. Simply open the Package Console Manager and run the following command. Install-Package Microsoft.AspNet.WebApi

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…

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

There are times when you might get the following error when running the application from Visual Studio or opening your application page in the browser. Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException) I received this error recently when trying to deploy the application in the IIS and accessing the page from the…

Building a ASP.NET Web API in Visual Studio 2015

This blog post will explain on how to create a Simple ASP.NET Web API using Microsoft Visual Studio 2015 and return an expose a List (Eg: List<Students>) over HTTP. This includes creating action methods and using them for get all students and get a particular student by id. How to create a Web API in Visual Studio 2015 and return a List over HTTP? Follow…

How to read a key from the Web.Config file in ASP.NET app using C# ?

If you want to read the values based on the key from the web.config file in your ASP.NET application using C# , you can use the  WebConfigurationManager to do it. How to read a key from the Web.Config file in ASP.NET app using C# ? Assume that the configuration file contains the below values If you want to read the value of the key (“UserName”)…

Liked this content?. Please spread the word :)