class file in asp.net version 2.0

V

vinodkus

I am unable to make a class file in asp.net in version2.0 . when i
make a class file class1.cs it gives the message it should be in App
folder. First of all u tell me what is app folder. but when i create
file in app folder it does not work why. why it is different from
version 1.1
help me plz
Thanks in advance
 
G

Guest

Assuming you are using VS 2005:

1. From the solution explorer, right-click on the project and select Add
ASP.NET Folder and click App_Code
2. Again from the sol. explorer, right-click App_Code and click Add New
Item... and select Class.

Alternatively, when you try to add a new item (class) at the project level,
simply click Yes on the dialog that asks whether you want to create the new
class in the App_Code.

<msdn>
App_Code - Contains source code for utility classes and business objects
(for example, .cs, .vb, and .jsl files) that you want to compile as part of
your application. In a dynamically compiled application, ASP.NET compiles the
code in the App_Code folder on the initial request to your application. Items
in this folder are then recompiled when any changes are detected.
....
</msdn>
 
M

Michael Nemtsev

Hello (e-mail address removed),

Just to add to Siva's post, App_Code in the way to divide your presentation
code from the other code, which loosely coupled with it.
With this way using MCV/MVP patterns are very good approach

---
WBR, Michael Nemtsev [.NET/C# MVP].
My blog: http://spaces.live.com/laflour
Team blog: http://devkids.blogspot.com/

"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top