Let's say you have a solution with two website projects, Website A and Website B. Now inside Website A's App_Code folder, there is a Class X defined in a ClassX.cs file. What do you do if Website B also needs access to ClassX.cs?
Is there any way to share this file across App_Code folders? Assume that moving the file to a common li...
So I'm having a really weird issue with my App_Code folder on a new website I'm designing.
I have a basic class inside of a namespace in the App_Code folder. Everything works fine in the IDE when I setup the namespace and make an object from the class. It brings up the class summary on hover, and when you click on "go to deffinition...
I am getting the following error when I put class files in subfolders of my App_Code folder:
errorCS0246: The type or namespace name 'MyClassName' could not be found (are you missing a using directive or an assembly reference?)
This class is not in a namespace at all. Any ideas?
...
I have a project with 2 subfolders in the App_code folder, one for VB and one for F# (C# files are in the root). I can access the VB classes just fine (via the namespace) but not the F# code. Has anyone had a problem like this and if so how did you fix it?
Addendum:
F# code that is not in the App_Code folder runs just fine. Is is as if ...
Why is that Web Service files (.asmx) have their code-behind placed in app_code folder by default unlike the regular .aspx files?
...
What should be the general guidelines/gotchas for dividing application code (App_Code) into separate files?
I've found that over time, the original files do not match up well with how the namespace hierarchy evolves. How do I keep application code containers organized intuitively over time?
What PURPOSE should the file divisions aim t...
Using VS2008, I am trying to add an App_Code folder from add-->folder-->Add ASP_NET folder.
The App_Code folder option is there as expected BUT ... it's disabled!?
I am pretty sure I am working with a WebSite project (and not a Web Application) because I can add all the other ASP_NET folders (App_Data - App_themes etc) and also because...
Is there a way to get a value I am storing in a Master Page hidden field from a User Class which I created and placed in the App_Code folder of my ASP.Net 2.0 Application?
Some examples would preferably in VB.Net is highly appreciated.
Thanks.
To give further details, assume the following:
MasterPage.Master
MasterPage.Master.vb
MyPa...
Let me try to ask this question from a different angle.
I noticed that everytime an aspx page gets rendered in the browser using the "web site" model, a random assembly gets created 'on-the-fly' in the Temporary ASP.NET files. Analyzing the assembly in Reflector shows that the class created for any given .aspx file is under the "ASP"...
Let's say I have a class (MyClass.cs) in App_Code (using a ASP.NET web site, not project). There's no namespace assigned to the class.
How can I get that class to be valid in the web site .aspx pages? WHAT do I need to put in the web.config file and WHERE do I need to put it?
Do I <add assembly tag or do I <add type ??
Since the ass...
I have created a MasterPage called MyMasterPage.
public partial class MyMasterPage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
I have also created a class called Class1 in app_code:
public class Class1
{
public Class1()
{
MyMasterPage m;
}
}
In Class1 I woul...
I'm writing a custom memberhsip provider based on the source for the SQL provider and I tried first making the SQL Provider a separate project. Yet, the web app wouldn't recognize it unless I put all the source in an APP_Code folder in my web app.
Is this how you implement a custom provider? I thought I could simply reference the provid...
I have an ASP.NET MVC application which is using Linq to SQL classes placed in the Model folder.
I want to create some extra classes that I would normally place in my BLL but I'm not sure how to work this with MVC.
With WebForms I would have my DAL as a Class Library.
My BLL as a class library that referenced my BLL.
My Web Site that ...
I am trying to better understand how the App-Code folder operates, and in particular I am curious how new objects that a new class in the App-Code folder are included in the current AppDomain. Is a second, temporary AppDomain created in the same manner as when I compile new objects with the CodeDom?
In many ways the capability of movin...
I am working in a .NET 2.0, recently upgraded to .NET 3.5 environment (VS2008, VB.NET) on an existing ASP.NET website project. I am able to generate a Linq-to-SQL Class (also called a DataContext?) in the App Code folder, drag over tables from an active connection, and save it. Let's call it MyDB. When I go to the code-behind file for my...
It is possible to have extra .Net "special" folders (App_Code, App_Themes, etc.) inside of a subdirectory, rather than in the root?
I am integrating with a CMS that dumps an enormous amount of stuff in the root. I would like to keep all my stuff in a single subfolder, as this will greatly ease my SVN and deployment burden. As it sits,...
I am creating a base class from which specific pages are going to be derived. That is, instead of inheriting my pages from System.Web.UI.Page, they're inheriting from MyPage (which in turn, inherits from System.Web.UI.Page).
However, I can't seem to be able to access the Profile property. Even though they both inherit from Page, I can o...
I have a website that has 2 files as follows:
page.aspx
page.aspx.cs
It used to be that I could just drop new files onto the web server and IIS would automatically compile the files and I could access the page e.g.
http://www.website.com/page.aspx
... and the associated functionality in the page class contained in the .cs file woul...
I have an ASP.NET web site where i am having App_code folder in which i put my class files (Business objects). Its running fine.But when i made some changes in the class (Added few proprties /Methods) and uploaded to the webserver (in production) its not getting affected in the live site.But this works pretty good when runs in local(so t...
I've moved one of my classes to the App_Code folder (and namespace) and inside of this class I have a reference to a global resource:
using Res = myProjectName.App_GlobalResources.Validation;
Before I moved this class to the App_Code folder, everything worked alright. Now I get a runtime error stating that:
CS0122: 'myProjectName.App...