The directory ‘/website/App_Code/’ is not allowed because the application is precompiled

Depending on your case, there are three possible scenarios: see this link http://www.beansoftware.com/ASP.NET-FAQ/Directory-App_Code-Not-Allowed.aspx Basically, If you precompiled your app, there shoudn’t be an App_Code folder. If you added it later, you should delete it. OR May be Somehow a precompiled.config file has made it to production. Deleting that file should resolve the App_Code directory error.

ASP.NET control to render a

Of course: ASP.NET has a built-in control called Panel! And you may use it as follows: <asp:Panel ID=”myPanel” runat=”server”> <!– Other markup here like client and server controls/elements –> </asp:Panel> It’s a container, so you add Controls to it in the code-behind like: myPanel.Controls.Add(new LiteralControl(“Hello World”)); You can add the Literal control (or any others) … Read more

Font awesome inside asp button

You can’t with the default asp.net button you will need to use a HTML button and give it runat=server attribute: <button runat=”server” id=”btnRun” class=”btn btn-mini” title=”Search”> <i class=”icon-camera-retro”></i> Search </button> So use code behind with this you add: onserverclick=”functionName” To the button, then in your C# do: protected void functionName(object sender, EventArgs e) { Response.Write(“Hello … Read more

Check if Cookie Exists

Sometimes you still need to know if Cookie exists in Response. Then you can check if cookie key exists: HttpContext.Current.Response.Cookies.AllKeys.Contains(“myCookie”) More info can be found here. In my case I had to modify Response Cookie in Application_EndRequest method in Global.asax. If Cookie doesn’t exist I don’t touch it: string name = “myCookie”; HttpContext context = … Read more

The type is defined in an assembly that is not referenced, how to find the cause?

When you get this error it isn’t always obvious what is going on, but as the error says – you are missing a reference. Take the following line of code as an example: MyObjectType a = new MyObjectType(“parameter”); It looks simple enough and you probably have referenced “MyObjectType” correctly. But lets say one of the … Read more

How to fix: Handler “PageHandlerFactory-Integrated” has a bad module “ManagedPipelineHandler” in its module list

It turns out that this is because ASP.Net was not completely installed with IIS even though I checked that box in the “Add Feature” dialog. To fix this, I simply ran the following command at the command prompt %windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -i If I had been on a 32 bit system, it would have looked like the … Read more