Thanks for the replies guys. I understand. Theres only one problem yet to be
ironed out in my mind. The code behind file is a class. Classes have
namespaces. For some reason I have a problem if I cant declare a class to be
in a namespace of my choice. I just cant seem to flush that from my system
that your not really supposed to do that.
If i want all source files to be in a namespace called
com.tietronix.testapp, how would i do that for the codebehind since it does
*not* sit in a directory structure of the format /com/tietronix/testapp BUT
sits in the web directory which is c:\inetpub\wwwroot\testweb
And thats another problem I have with VS.net. Why does it not allow me to
choose a directory on the local machine for my asp.net source files and on
build time - allow me to publish to a webserver? I want to isolate my source
files and my deployment files. Cause when you deploy, you dont need the
codebehind classes. you just need the assembly. I like to maintain this
directory structure since all my source files tend to sit in vss and src and
build files intermingling are just my pet peeves.
thanks. Im confused and I guess there is more than one q here.
If you cant answer them - thats ok. Everything slowly becomes clear anyways
after a few weeks of development. This is my first week of developing on the
..net platform.
thanks for your help.
girish
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:gD**************@cpmsftngxa07.phx.gbl...
Hi Girish,
Thanks for posting in the community! From your description, you'd like to
set the codebehind file and the aspx file in separate folders, also you're
wanting some information or guides on using the code-behind file when
developing ASP.NET web page.
As for the first question, I quite agree with Jiange's suggestion. Since
the codebehind file is generated for us help develop the web pages more
conveniently at design time, it's better to make them together within the
same location.
And I've searched some references and tech articles on the description and
how to use the "code-behind" mode to develop ASP.NET web pages with
VS.NET, you may have a check to see whether they're helpful to you. Here are the
web links to them:
#Web Forms Code Model
http://msdn.microsoft.com/library/en...msCodeModel.as p?frame=true
#Developing User Controls in a Code-Behind File
http://msdn.microsoft.com/library/en...lopingusercont rolsincode-behindfile.asp?frame=true
#INFO: ASP.NET Code-Behind Model Overview
http://support.microsoft.com/default...b;en-us;303247
#HOW TO: Work with Code-Behind Class Files in an ASP.NET Application by
Using Visual C# .NET
http://support.microsoft.com/default...b;en-us;308143
If you have any questions or need any further help, please feel free to
post here.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)