app-code

App_Code duplicate variable in DLLs

I've moved a class to the App_Code folder and I'm now receiving the following error message: CS0433: The type 'myProject.App_Code.ItemType' exists in both 'c:\WINDOWS\ Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\8cdcbe9c\ b9695514\assembly\dl3\e5cfe230\82ca7cf7_5c89ca01\myProject.DLL' and 'c:\WINDOWS\Microsoft.NET\F...

Question about moving common routines to the App_Code Class

I have some common code that I would like to share between pages and I have been messing around with App_Code classes which is great but I would also like to use code that affects drop down lists example: Sub Set_FirmType(ByVal Sender As Object, ByVal E As EventArgs) subcategories.Visible = "false" supplycategories.Visible = "f...

Class Library Project VS App_Code - Pros / Cons?

I currently use the App_Code folder for all of my classes, and for me (for now) it seems to be working just fine. I have however been considering making the switch over to a Class Library Project inside my Solution instead of the App_Code folder. Can anyone tell me the pros and cons of doing this? One thought I had was with regards to...

Is it possible to add two language code files i.e. C# and VB.NET to App_Code? If so, how I could achieve this?

While adding two language code files i.e. C# and VB.NET to App_Code, got an error The files ... file names ... use a different language, which is not allowed since they need to be compiled together. Is there a way to add two different language files? ...

ASP.NET MVC using App_Code directory

I've added an App_Code directory to my ASP.NET MVC project so that I get dynamic compilation for plugins. Only slight annoyance is that when developing new plugins, I don't get intellisense on classes inside the App_Code directory. Currently I am creating them in another directory inside my project and then copying them into App_Code. ...

My ASP.NET Web Application cannot 'find' any of my classes in the App_Code folder .. ??

Hi folks, I'm trying to make a new asp.net web application .. so I'm copying my files from one site to the new one, in the same solution. Now, any of my classes in the App_Code directory ... they are not getting 'picked up' by the rest of my project. For example... \_ \_App_Code |_ BaseMasterPage.cs (please don't ask why this is ...

Clean conflicting class files from Temporary ASP.NET Files

Class file Conflicts in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ is preventing me from building the solution. Even though I try emptying out the folder, each time Visual Studio starts the build process, it brings in the class file in to the temp folder with the same folder name. If I restart the machine or l...

ASP.NET null reference exception

Please help me to figure out what is wrong with this code: I have ASP.NET page with one button visible. When user clicks it - it instances MyClass (its implementation is in AppCode directory) and turns invisible (button2 becomes visible). When I click button2 it raises "Object reference not set to an instance of an object" Exception...

Get Enum List via GetType

Hello everybody I have code that gives a list of all possible values for any given enum i bound it pretty often to dropdownlists in my webpages now im trying to make a usercontrol which accepts the type name as a parameter, which in turn calls the code to create the value list as my sub expects a type parameter Shared Function EnumLis...

ASP.NET MVC: files containing extension methods inside App_Code must have Build Action "None"?

This seems to be the only thing that works: If a .cs file is inside App_Code... And does not contain extension methods: set the build action to "Compile"; otherwise no other source code in the project knows of its existence. And contains extension methods: set the build action to "None"; otherwise you get an error that the reference t...

Using class in App_code - Finding controls on the page that uses that class

Hope this will be understandable. Going to simplify the code alot. I have a Master page, then i have Default.aspx. In this Default page i have the following. <asp:Content ID="Content2" ContentPlaceHolderID="CPH_Main" Runat="Server"> <asp:Panel ID="Panel1" runat="server"> </asp:Panel> </asp:Content> Ok, so i have a class in th...

C# asp.net - The type or namespace name 'Helper' could not be found (are you missing a using directive or an assembly reference?)

I'm reworking someone else's code, where they had a helper class with way to much code that shouldn't be there (data access, business logic, everything had slowly been shoved in there). I've moved the relevant code into the appropriate pre-existing classes and created a separate, brand new helper class in the appropriate project, but al...

Visual Studio hangs when changes are made to source codes in Asp.Net App_Code folder

Hi, My Visual Studio will hang everytime I make some small changes to the Codes in the App_Code folder. I checked in the folder.. there are about 91 Files in 62 Folders. Any suggestions on how I can improve its performance? ...

.Net Build and File Save in App_Code folder

In Visual Studio 2008, when I save a file in the App_Code folder it takes quite a lot longer to save than a similar sized file that is located outside of App_Code folder. Similarly, when I make changes to the code in a file in the App_Code folder, it takes the .Net Solution a lot longer to compile than it does when making code changes...

Dynamic parameters for attributes

I know parameters to attribute declarations have to be a constant expression and resolved at compile time. However, can I play with the concept of 'compile time'? ASP.net has the concept of App_Code folder. It looks from it's description like you can drop .cs files into it, even while the app is running, and it will be brought in and com...

Possible to turn off App_Code auto-compile?

Working with Visual Studio (I'm using 2008) I have started to notice that when you save a file in the /App_Code folder, the program will hang for a bit before returning control. After a bit of research, I have learned that there's an auto-compile feature at work, which I assume is what is slowing down my system. So the question is this...

ASP.NET web site can't see .cs file in App_Code folder

So I have an ASP.NET web site (not web application) I'm making in VS2010 with C#. It runs fine on my machine, but when I upload it to the site it's hosted on, it won't compile, giving: "CS0246: The type or namespace name 'DataAccess' could not be found (are you missing a using directive or an assembly reference?)" I've been using the co...