webForumDet fria alternativet

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

1 svar · 507 visningar · startad av Travoni

TravoniMedlem sedan okt. 20041 556 inlägg
#1

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;
   }
}
TravoniMedlem sedan okt. 20041 556 inlägg
#2

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

126 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
123 ms — hämta tråd, inlägg och bilagor (db)