Where are project files?

  • Thread starter Thread starter Vik
  • Start date Start date
V

Vik

1. I created a VS2005 ASP.NET project in C#. It contains the aspx and
aspx.cs files with the partial classes. Where are the files with the control
declarations?

2. I got a a VS2005 ASP.NET project in C# from an employee who left a
company. It contains the aspx files, no *.cs files and the
Asp_Web_*.aspx.*.dll files in a bin folder for each aspx file. How these
dll's were created? (The dll's are not created in my project when I click
Buld Web Site). Are the original *.cs files moved to another location when
the dll's are created?

Thanks.
 
Most likely, these are ASP .NET Web "Sites", and not ASP .NET Web
Application "Projects".

ASP.NET Web sites are dynamically compiled based on the declarative markup
in the .aspx page.

Also, it is possible to place server code (code that would otherwise be in a
..cs file), directly inline within the .aspx page itself.

-Scott
 
You are right, these are the Web Sites, not the projects (I believe they
were called projects in VS2003).
The code is not within the aspx pages.
Could you tell where may be the designer code for the first site and why
there are dll's in the second site and not in the first one?

Thanks.

Vik
 
ASP .NET Web Sites did not exist in VS 2003. In VS 2003, you had ASP .NET
Web Application Projects. These were initially done away with by Microsoft
with the first release of VS 2005 in favor of ASP .NET Web Sites. There are
VERY many things that differ between the two, but one most notable
difference is that, rather than all the code-behind's of a traditional Web
Application Project being compiled into one assembly (.dll) at design-time,
Web Sites are not pre-compiled by default (and that's why you can't find the
"designer files), the are dynamically compiled at run-time. Also, even when
that compile happens, each page is compiled into its own assembly (.dll).

This type of development was created to give developers of large sites a
more fine level of granular control over the contents of their sites.

There was immediate "grumbling" from VS 2003 developers, who were already
invested in the more traditional "Project" structure for the ASP .NET work,
and Micorosft added support for ASP.NET Web Application Projects back into
VS 2005 with SP1. With VS 2008, you can do either type of work right out of
the box.

1. So, as for designer files in a Web Site, they don't exist, so stop
looking for them - you won't find them.
2. As for the page event-handling code, that *can* still be written in the
traditional code-behind paradigm or the code *can* be injected directly into
the .aspx page in a server-side script tag up at the top of the file.
However, so much works right out of the box in VS 2005/2008, that you can
get a lot of functionality without writing any code at all (again, the
controld declare what they want to do via their properties and that is
dynamically translated into code at run time).

Now, since each page is effectively its own island in a web site (no more
single assembly for all the pages), any code that must be available to all
pages, is generally kept in a special web site folder called "App_Code".

As for the .dlls that you are referring to, it is most likely that they were
pre-compiled (not the default action) by clicking the Build menu and then
the "Publish" option. This allows you to pre-compile the page .dlls, so
that this doesn't have to happen at run-time. They are not essential to the
development process though.

I think that most enterprise developers would tell you that web sites are
not worth the trouble. Since they are not "Projects", they are not "built"
(and this is why pressing the "build" button didn't do any creation of code
for you), and if you're not careful, result in your source code having to be
deployed to the production environment.

Have a look at these for more info.:

http://www.c-sharpcorner.com/UploadFile/kalisk/website02232009162404PM/website.aspx
http://www.codersbarn.com/post/2008/06/ASPNET-Web-Site-versus-Web-Application-Project.aspx
http://aspnetresources.com/blog/web_site_vs_web_application_project_wap.aspx

-Scott
 
I didn't say there was, but obviously the OP is new to VS 2005 and in VS
2003, where he is coming from, VS didn't offer the inline model. Since he's
having trouble finding the code, I was pointing out that this option exists
in the project type that he's using.

-Scott
 
Mark,

I (and many others) prefer top-posts because if you are involved in a long
thread, you don't have to scroll down, page after page, to see a short reply
someone may have added. That topic has been debated ad-nauseum and I've
been a contributor to these NG's for over a decade, so I don't feel I need a
lecture on how to use them. I'll just finish that thought by saying that
things have changed a bit since the inception of the Usenet.

As for VS 2003 supporting inline code, let me say that the link you provided
didn't really have much that immediately made your point that inline code
was/is supported in VS 2003. AFAIK, VS 2003 even with SP1 did not offer an
inline coding model for an .aspx item template.

That's not to say that you couldn't *do* inline coding in VS 2003, which is
not what I said. I said VS 2003 didn't *offer* an inline coding model, not
that it didn't *support* inline coding. Either way, you are parsing the
point so finely that you've missed the bigger picture. The OP is new to VS
2005 and only knows how VS 2003 did things. VS 2003 didn't *offer up* an
inline coding model and VS 2005 does. The purpose of me bringing inline
into the discussion was to point out something new that the OP has available
to him that he probably never ran into with VS 2003. He's asking where his
code-behinds were, so obviously he doesn't know about coding inline.

I'll direct you to this link:
http://www.developer.com/net/csharp/article.php/3087791 for an article by
Dino Espisito that discusses ASP.NET 1.x development and code-behinds.

-Scott



Mark Rae said:
[please don't top-post]
I didn't say there was, but obviously the OP is new to VS 2005 and in VS
2003, where he is coming from, VS didn't offer the inline model.

Er, yes it did:
http://www.google.co.uk/search?sour...-GBGB298GB298&q=Visual+Studio.NET+2003+inline
 
I (and many others) prefer top-posts

Just as many (if not more) prefer bottom posting to avoid having to read
posts backwards.
because if you are involved in a long thread, you don't have to scroll
down, page after page, to see a short reply someone may have added.

That's what proper snipping is for.
I've been a contributor to these NG's for over a decade

And you still haven't learnt to post correctly?
so I don't feel I need a lecture on how to use them.

If you think that a polite request to post properly is a 'lecture', then
you've obviously led a charmed life on newsgroups!
I'll just finish that thought by saying that things have changed a bit
since the inception of the Usenet.

How so?
That's not to say that you couldn't *do* inline coding in VS 2003, which
is not what I said. I said VS 2003 didn't *offer* an inline coding model,
not that it didn't *support* inline coding.

That is one of the stupidest comments I've heard for ages!

DJ
 
If you really feel that the computing experience hasn't change since the
inception of Usenet and you also feel that there is no difference between
Visual Studio *supporting* someting vs. *offering* to do it that way, then
clearly you've identified yourself as a troll and someone who just likes to
hear themself talk.

Clearly, you aren't familiar with VS or you would fully understand what is
being discussed.

-Scott
 
If you really feel that the computing experience hasn't change since the
inception of Usenet and you also feel that there is no difference between
Visual Studio *supporting* something vs. *offering* to do it that way,
then clearly you've identified yourself as a troll and someone who just
likes to hear himself talk.

Clearly, you aren't familiar with VS or you would fully understand what is
being discussed.

Yeah, that must be it.

Thanks.

<plonk>
 
Scott, thank you for the detailed explanation.
I installed an ad-in for the VS2005 to work with the Web projects (SP1 is
not installed yet) but I still don't see a Web project among the project
templates when I try to create a New project.

Viktor
 
Hi Viktor,

First, even if you installed the VS 2005 Web Application Project add-in,
that won't change the fact that you already have web sites. It just means
that going forward, you can make WAP's.

Assuming you've installed the correct add-in, you should see the option to
create an "ASP .NET Web Application Project" in the "New Project" dialog,
under the "Web" category.

I would recommend you do the full SP 1 upgrade though.

-Scott
 
Back
Top