Visual Studio :: Web Site App_Code Classes Not Accessible?

Aug 5, 2010

I am fairly new to ASP.net and web page development. I normally create Windows Apps, but the move is on to web pages. I have read and tried a number of posts on this matter, but none of them resolved the problem I am having. I have created a web site (I'm positive it is a web site) and added a class. Visual Studio automatically created and added the class to the App_Code folder. Accordingly, I added the get/set methods to the class and made them public. When ever I try to access the class from a code behind for any page, I get the class name, but nothing more. Intellisense shows only Equals and EqualsReference - no variables. I'm used to using classes in windows forms application and this would make life so much easier if it worked like it is supposed to work.

View 2 Replies


Similar Messages:

Visual Studio 2010 C# And Classes In App_Code Folder?

Jan 7, 2011

I've searched but not found much that helps, could be using wrong search terms.Anyway, currently using Visual Studio 2005 and VB, but just got Visual Studio 2010 and trying to use C# and am having problems using classes, I think I'm missing something simple here.

In both 2005 & 2010 I create a new website and a Default.aspx, in 2005 using VB, C# in 2010.

Right-click the project -> Add New Item -> Class, and leave it as Class1.vb/Class1.cs

Both 2005 & 2010 prompt to place it in the App_Code folder, so choose yes.

Here are the class files, I've not changed anything apart from create a very simple function:

Class1.vb code: [Code]....

Class1.cs code: [Code]....

In my VB project Default.aspx.vb: [Code]....

No errors, and debugging shows that a = "hello"

My Default.aspx.cs: [Code]....

This gives an error:Error 1 The name 'tester' does not exist in the current context D:Visual Studio 2010WebSite11Default.aspx.cs

How do I reference the tester function within Class1 in my C# project?

View 4 Replies

Visual Studio :: What Is The Difference Between Designer Classes And T4 Template Generated Classes

Jan 11, 2010

I am new to LINQ. when we drag tables we get a dbml file and designer file.

For example DataClasses1.dbml and DataClasses1.designer.cs.

Once we have them then we can start using our LINQ Queries.

In my company project I do not see this designer files and instead there are .tt files which were used as templates to greate ABC.generated.cs files. Is this same as designer class?

View 3 Replies

Visual Studio :: How To Convert Whole Visual Studio 2008 Web Site Project To Visual Studio 2010

Aug 14, 2010

is it possible to convert whole visual studio 2008 web site project to visual studio 2010 web site project

my current project references

i have a very annoying iis problem

iis server stops working until app pool is recycled

i am hoping that new visual studio (net framework 4.0) may solve this very annoying unsolveable problem

View 2 Replies

Visual Studio :: Any Better Way To Create An App_Code.dll?

Mar 10, 2010

I am using visual studio 2008 professional. I created a unit test project for my current website (project). This unit testing project is mainly testing code in App-Code folder. In order to be able to access classes from App_Class I need to add App_Code.dll reference to my unit testing project. Right now, I am doing like: publish website, which produce App_Code.dll. Then I added it to my unit testing project. This is very time consuming process: if I make any changes on under test class, I need to publish website to get App_Code.dll. It takes at lest 4 minutes to publish and get App-code.dll. If I have add the new App-code to my unit testing project, it takes about 1 to 2 minites. Is there an easier way toget App_Code.dll?

I have tried use Accessor that MS Test autogenerated, which deos not need App_Code.dll, however, I cannot get an object instantiated. So that is why I add App_Code.dll to my test project.

View 2 Replies

Visual Studio :: Solution Explorer Only Creates Visual Basic LinqToSql Classes?

Feb 14, 2010

Even though I when I create a linqtosql class I mark C# as the language it was always shows up as a Visual Basic file in the App Code file. I can't get it to stop doing that. ????? What is going on?

View 5 Replies

App_Code Folder In Project In VIsual Studio 2010

Jun 22, 2010

at vs2008 i could set App_Code folder, but at vs2010 i can not do it, that's why i put my dataset's and class' to App_Data folder. Either I do not know even App_Data folder is secure?

View 4 Replies

Visual Studio :: The App_Code Folder And Recycling Samples?

Feb 14, 2010

I am a developer who up until now only used WAP assemblies. Is that old and outdated nowadays? For example I have found a really great sample of google map API I'l like to use but my project is in VB.NET and the sample is using code in App_Code folder in C# so I cannot mix and integrate in a easy way. Do I have to convert the C# code into VB.Net to make it work or is there a shortcut when finding sample code in App_Code folder in the wrong code language?

View 1 Replies

CodeBehind Class Not Accessible To Code In App_Code Folder?

Jan 31, 2010

I have a PlannerShiftView user control in the root folder of my ASP.NET web site. In my App_Code folder, I have a ShiftViewTemplate class that needs to instantiate a PlannerShiftView (for a TemplateField in a GridView). The problem is, the following code doesn't compile because the PlannerShiftView type is not available in what I deem to be the App_Code 'phantom namespace'.

Please can somebody explain to be what is happening here, as well as what to do. I know I can just move the ShiftViewTemplate out of App_Code, going against convention and without explantion, but that is something of a hollow victory.

View 1 Replies

Visual Studio :: New Class File In App_Code In Vs 2010 In New Web Project Not Compiling

May 23, 2010

Best way to describe my issue with vs 2010.create a new website. create the App_Code folder. create a new class in the folder. put the line "x" in the class declaration. hit compile. And the website will compile with no errors. It's not "seeing" this new class as being part of the project best I can tell.

View 1 Replies

Visual Studio :: The Intellisense Doesn't Work At The App_Code Folder Level

Feb 22, 2010

My problem is that the intellisense is not enabled within the App_Code folder, so to twick this problem I initially create a separate folder where I develop my classes then I move them to the App_Code but, but I'm convinced that this is not the right practice so how to configure visual studio 2008 to enable intellisense at the App_Code folder

View 4 Replies

Visual Studio :: To Use A Sql Server 2008 Database When Adding New Data Item To App_code?

Jul 11, 2010

I am using Visual Studio 2010 and have a full version of SQL Server 2008 (not SQL Server Express 2008). I would like to be able to use the database that I created in Sql Server 2008 (not sql server 2008 express) but when I go to app_code -> Add Item and select SQL Server I get the following error message:

"Connections to SQL Server database files (.mdf) requires Sql Server 2005 Express or Sql Server 2008 Express to be installed an running on the local computer ..."

Do I really need to have sql server 2008 express installed on my local computer when I already have the full blown version of Sql Server 2008 installed on my local computer.

View 1 Replies

Class In App_Code Not Accessible By Global.asax.cs Error - Namespace Name 'MyClass' Could Not Be Found

Nov 18, 2010

I've created a new class in App_Code

namespace Site {
public class MyClass {
public MyClass() {
}
}
}

this is my Global.asax.cs

[code]....

The error is in: MyClass myClass = new MyClass();

The type or namespace name 'MyClass' could not be found (are you missing a using directive or an assembly reference?)

View 1 Replies

Visual Studio :: Can't Find New Classes In Namespace

May 1, 2010

Can't find new classes in namespace

View 3 Replies

Visual Studio 2010 Getting .dll For Project Classes?

Sep 21, 2010

I'm using VS 2010. I got the references to the classes from my project, now I need the .dll files but I can't seem to find them. How do you add the .dll's?

View 1 Replies

Visual Studio 2010 Puts 4.0 Classes Into 3.5 Project?

Jun 21, 2010

I have existing ASP.NET 3.5 project I migrated to Visual Studio 2010. I didn't migrate it to .NET 4.0. Every time I try to edit .aspx page, it alters the .designer.cs class to point to System.Web.UI.WebControls.WebParts.UpdatePanel class instead of

System.Web.UI.UpdatePanel

class and then the build of course produces an error. The project properties says ".NET3.5".Also the "design" tab produces just one box saying "unknown server tag asp:UpdatePanel". It seems like it is looking at .NET4.0 to generate the desgn view, not 3.5

Is there a setting somewhere I need to change?

View 3 Replies

Visual Studio :: Add Shared Classes / Files Into Project

Feb 20, 2011

VWD 2010 Express.

We have shared CSharp classes put into a shared folders for re-use. Now I want to add those classes into my project by creating a new folder:

1) Right click the solution,
Add -> New Folder
Give it a new, eg. SharedClasses

2) Right click the new folder "SharedClasses"
Add- > Existing Item...

Browse to the "Shared Folder", include those shared classes. But those files are added physically into the folder "SharedClasses" rather than a reference. How do I just add a link to those shared files? Since these files might be modified from time to time, I don't want to delete and add those file frequently.

View 3 Replies

Visual Studio :: Classes From Class Not Present In Web Project

Nov 24, 2010

I've build a Class Library, in the same project i put a web project. But its impossible to access the classes from the dll generated by the class library. Whats wrong? JumpTide XML uses the namespace like:

namespace JumpTideClassLib
{
public class jumptidexml
{
public class MetaTags
{

Image:

View 1 Replies

Visual Studio :: How To Change Font Color Of Classes

Aug 10, 2010

My class names are this annoyingly bright-blue color and I can't figure out which display item class names would fall into under the fonts and colors option.

View 2 Replies

Prevent Visual Studio From Appending Folder Name To New Classes?

May 28, 2010

How can I prevent Visual Studio from naming the classes for new pages that are in folders from being named with the folder name? Does this method not set "right" with anyone else?

View 1 Replies

Visual Studio :: Web Site / Web Application Templates Seem Changed - Default.aspx Only With Site.master

Oct 21, 2010

Using Visual Web Developer 2010 Express. I was used to creating a web app anytime and I would get a default page for starters and be happy. But today I find that when I pick either the ASP.NET Web Site or ASP.NET Web Application templates I get site.master and a bunch of site admin files that I don't want. Alternately when I select the empty versions of those templates, I get almost nothing at all. An almost empty web.config page and no Default.aspx page. There is nothing magical about having a default.aspx page in place, but it is an indicator of a change when I can only get a virtually completely empty website or a website with a bunch of bells and whistles I don't want.

Also, for some reason, when I create a new app or website as just noted, in the Solution Explorer I get aspx.designer.cs files showing as well as web.config files for both debug and release. Somehow some settings and templates must have changed, or am I missing something here? How can I get my settings/templates to go back to the way they were?

View 1 Replies

Visual Studio :: Can Not Create An C# ASP.NET Web Site From Visual Studio 2010

May 27, 2010

I downloaded a trial version of Visual Studio 2010, created a new c# Solution and then wanted to add an ASP.NET Web Site. I am Folllowing an example in a book: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008.In the book they write that a template for createing an c# ASP.NET Web Site would be found, but whereever I search for o template in VisualStudio I cant find that for c#, I could find it for VisualBasic but that is not wath I want!

View 1 Replies

Visual Studio :: Visual Studio 'copy Web Site' Error

Oct 31, 2010

I am getting the following error when I try to establish ftp remote connection using the 'copy web site' feature on visual studio 2005.

unable to open the web 'ftp://209.*.*.*/httpdocs'. The computer is disconnected from the network.

Why can't I connect to the remote site on visual studio 2005? I can do the same thing on Dreamweaver with no problem. I can ping the IP successfully. I can open the ftp URL on a web browser with no problem.

View 1 Replies

Visual Studio :: Debug Classic Asp Site That Is Called From Site?

Mar 28, 2011

i have an asp.net website which contains a link to a legacy site written in classic asp which has vb 6 classes (dll) in the back ground also.here is what i am trying to achieve:-i want to browse to the asp.net website using IE7,then when the link is clicked then enters the classic asp site i want to start debugging the classic asp and step through it.(also to make things worse, once a the vb6 class is instanciated, and a call make to its method i want to debug the method in the vb 6 code)My system :- XP Pro, IIS 5, Visual Studio 2005 (asp.net project ), Visual interdev 6 (classic asp project) Visual Basic 6 (vb 6 classes compiled into dll)i have been trying everything with no joy, there is lots on the net but nothing seems to have worked.i have the back office components installed so asp debugging is possible, i have configured the asp website s debugging is turned on.if i add a breakpoint to the classic asp site and hit the start button in visual interdev i can step through it fine.My problem is that if i attach interdev to a process (iexplorer.exe or dll.host) then the breakpoints are not hit. if anyone can help me with this it would be great.ont top of that, if anyone can explain to me how to also debug the vb6 dll code in visual basic 6 when it is called from the classic asp site that would be great!

View 1 Replies

App_Code Folder Of Project Contain Both C# And VB# Classes?

Sep 17, 2010

Using vb.net/asp.net 2005. I have a project that is done with all vb.net, however I want to get some more experience with C#.Net. I am considering creating a new database class to put in the app_code folder.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved