---
title: "The virtual path 'TesteUserControl.ascx' maps to another application..."
type: "forum-thread"
url: "https://www.webforum.nu/amne/dotnet/171897-the-virtual-path-testeusercontrol-ascx-maps-to-another-application"
topic: ".NET"
topic_url: "https://www.webforum.nu/amne/dotnet"
author: "Travoni"
published: "2008-06-01T12:32:42.000Z"
updated: "2008-06-01T12:45:21.000Z"
replies: 1
views: 515
page: 1
pages: 1
language: "sv-SE"
site: "webForum — webforum.nu"
rights: "Upphovsrätten till varje inlägg tillhör dess författare."
attribution: "Citera som: webForum, https://www.webforum.nu/amne/dotnet/171897-the-virtual-path-testeusercontrol-ascx-maps-to-another-application"
---

# The virtual path 'TesteUserControl.ascx' maps to another application...

## #1 — Travoni, 2008-06-01T12:32Z

Min "server" crachar när jag kör denna applikation.

**The virtual path 'TesteUserControl.ascx' maps to another application, which is not allowed.** (På den röda raden)

Någon som vet vad felet är?

```
public partial class WebPartListControl : System.Web.UI.UserControl
{

   public override bool HasControls()
   {
      return true;
   }

   protected override ControlCollection CreateControlCollection()
   {
      ControlCollection controls = new ControlCollection(this);
      [B][red]Control x = LoadControl("TesteUserControl.ascx");[/red][/B]
      x.ID = "TesteUserControl.ascx";
      controls.Add(x);
      return controls;
   }
}
```

Permalänk: https://www.webforum.nu/p/171897

## #2 — Travoni, 2008-06-01T12:45Z

Ooops, hade visst glömt en thilde här
Control x = LoadControl("\~/TesteUserControl.ascx");

Permalänk: https://www.webforum.nu/p/2116272

---

Tråden på webben: https://www.webforum.nu/amne/dotnet/171897-the-virtual-path-testeusercontrol-ascx-maps-to-another-application
