Set Client Target in Web.config

When you develop your ASP application, you might face rendering issues with some web browsers. In this article I will give you a step-by-step on to set a client target in your ASP application to solve rendering issues.

Getting Started

1. Open your ASP project.

2. In the file explorer, open the web.config file of your project:

webconfig open asp tutorials

3. Find the <system.web> element. There we are going to declare the ClientTarget alias to set the user agent to be used. Start by opening the <clienttarget> elements:

client target element asp tutorials arvixe windows hosting

4. Now let’s add the alias. In this case I have issues with the latest version of Internet Explorer and also with “Edge”. I will set my app to load in “Compatibility Mode” by entering the alias and the user agent:

<add alias="ie11" userAgent="Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"/>

add alias user agent webconfig arvixe tutorials asp hosting

5. Save your changes. And that’s it! User Agent has been set!

This concludes Set Client Target in Web.config

Looking for quality Windows Hosting? Look no further than Arvixe Web Hosting!

Happy Hosting!

Tags: , , , , , , , , , , , | Posted under ASP .NET 3.5, DotNet/Windows Hosting | RSS 2.0

Author Spotlight

Rodolfo Hernandez

I like photography and reading books. Currently working for Arvixe as Elgg Community Liaison. Elgg Security Expert Web Security Expert CEO of UDP SW Social Web

Leave a Reply

Your email address will not be published. Required fields are marked *