Click to See Complete Forum and Search --> : Web application using c#


lsy
May 3rd, 2009, 03:20 AM
i'm first to create web application, i'm curious how can i create a web application in VS2005 with using C#... i found some sample in net, but the first step is always File->New Project, then choose ASP Web Application, but i can't find this choice in my dialog.
In the New project menu, in the vs installed templates, there are only
Windows Application
Windows Controls Library
Crystal Report Application
Class Library
Console Application
Device Application


Please help...

nelo
May 3rd, 2009, 05:01 PM
Hi,

For VS2005 the model is slightly different for web applications. You will have to follow this path...

File -> New Website

This has changed again with VS2008 so you have the two options (i.e. Web Site and Web Application Project).

lsy
May 3rd, 2009, 08:45 PM
Hi,

For VS2005 the model is slightly different for web applications. You will have to follow this path...

File -> New Website

This has changed again with VS2008 so you have the two options (i.e. Web Site and Web Application Project).

ok, thanks...
due to i'm first time writing web app, i'm not very sure how web application is really works...
when i run the app, it will show a webpage... but it only can be compile as debug mode... there are no release mode for the compilation??
is website application have kind of bin folder which storing the debug and release folder?? how open my website from windows instead using VS?

Peter_APIIT
May 3rd, 2009, 09:25 PM
What is the different between Web Site and Web Application Project in VS 2008 ?

nelo
May 5th, 2009, 06:11 AM
What is the different between Web Site and Web Application Project in VS 2008 ?
When you use the Web Site template Visual Studio allows you to point to a directory on your file system and everything in that directory is considered to part of the web site. There is no concept of a project or solution file which keeps a track of what is included/excluded from the project.

When you use the Web Application template you get that concept of a standard project where you can specify which files should be included in the build. You can specify a number of project related properties like custom build steps, output directories, etc.
On my personal projects I use Web Site. The advantage of the web application project is that you can easily keep a track of changes. This is very useful if you're working in a team.


when i run the app, it will show a webpage... but it only can be compile as debug mode... there are no release mode for the compilation??
is website application have kind of bin folder which storing the debug and release folder?? how open my website from windows instead using VS?
If you hit F5 you are asking the environment to run your site in debug mode hence there will be a compilation in debug mode. The web.config file has a setting that you can change when you want to deploy the site (<compilation debug="false">). Remember that any code files are compiled just in time. So there is no bin folder on your file system as such.

How do you want open your website from windows? What do you mean? You can certainly browse to the directory where your files are (if you go with the default that would be something like ..\My Documents\Visual Studio 2005\Web Sites\<Your web site here>). If you want to access your website through the browser you have two choices. If you are using the Visual Studio development webserver (which is what it uses when you hit F5 or CTRL+F5) you would use a url like http://localhost:<port number>/<Your web site here>. The other option if you have IIS is to setup a virtual directory that points to the directory in the file system where your web site files are. As part of that you have full control over the url (i.e. it doesn't have to be called <Your web site>.

I hope this makes things clearer :)

Peter_APIIT
May 6th, 2009, 09:25 PM
Too bad for VS 2005 does not have web application Project template.