Can't see Default.aspx file in Visual Studio - asp.net

I've watched a tutorial on youtube about ASP.net. I've created a new ASP.NET Web Application but I can't see the .aspx file anywhere in the solution explorer. So I wonder if I'm blind or I need to additionally create it? This is what my solution explorer looks like:

You might be confusing between these options. Try experimenting with all these options.

Related

Display a custom html page when publishing to IIS in MVC

I have an MVC5 application and I want to display an html (or htm) page while publishing the application to IIS server. So, I tried different methods by using app_offline.htm as indicated on ASP.NET Web Deployment using Visual Studio: Deploying a Code Update. But none of them works properly in MVC. Is there a better approach to make this?
Seems like app_offline.html customization not supported yet. See https://github.com/aspnet/Tooling/issues/530.
Also, there is similar question Custom app_offline.htm file during publish.

ASP.NET page shows up as plain HTML-code

So, I just started learning ASP.NET and I wanted to make a very simple website for a project I'm working on.
I made one page and published it via Visual Studio, but all it shows is plain HTML.
You can find it here:
http://www.limburgsewolven.host-ed.me/Default.aspx
Has somebody got any idea why it shows up like this? :s The host is supposed to be able to host ASP.NET 2.0, so that's what I used.
Thanks!

Where to write ASP Code in visual studio?

A silly question to ask. Actually I am a developer in ASP.NET, but as per the project requirements, I have to work on Classic ASP. Now I would like to know how and where to write the Classic ASP code in MS VISUAL STUDIO-2008. Since when we start a new website it says ASP.NET Website and not ASP.
A little search on SO will lead you to this It should works also in VS2008
Just add a new item in your project, choose text file and change the extension to asp.
If you want to write code of classic-asp in visual studio then write it in source file
which is the design page. Dont write it in class(.cs) file.
But my suggestion is if you wanna write efficient code of classic-asp then use Dreamweaver

Visual Studio 2010: convert website project to web application project?

I have an existing solution in VS2010. When I click the properties of my project I get the view as can be seen in image1.png:
When I create a new empty ASP.NET web application and click the properties of my project I get the view as can be seen in image2.png:
A huge difference.
Now I'm implementing this code here: http://wcf.codeplex.com/wikipage?title=Getting%20started:%20Building%20a%20simple%20web%20api
And that tutorial assumes I get a view as I've shown you in image2.png
In image1 and image2 I've also marked the menu items: "Website" and "Project"
This makes me assume that I've created a website application whereas I need something different (I'm thinking a web application project).
Not sure what to do now, I need to convert my current application to another thing, but to which type and how to do it?
I also came accoss this post: http://blogs.msdn.com/b/webdevtools/archive/2009/10/29/converting-a-web-site-project-to-a-web-application-project.aspx
But before I start screwing up everything :P Is that what would solve my problem?
It should be possible to use either a web site or a web application project. In the example on the link you've posted, they use the predefined template for ASP.Net MVC Web Applications. This has several advantages - it sets up the structure and other resources for you - it's effectively a template.
For the purposes of the tutorial, why don't you just set up an application that way? If you've already written some code, you can just import it into the new application.
For future projects, you might want to consider which is best for your needs. Apart from structure, there are some other key differences between a web application and a web site project.
MSDN handily provides the differences here:
http://msdn.microsoft.com/en-us/library/dd547590.aspx
If you find you want the features of the web application, then the link you've posted is fine. You'll need to do some re-organizing of your references and so on and so forth, but the process is fairly straightforward (but not painless).
A "web site" in visual studio is the old, .net 1 style of creating web sites. It basically dynamically compiles the code in a folder when it's hit for the first time. Later .NET introduced a "web application" model where the code is compiled into a DLL and no code files are deployed with the site. "Web sites" are pretty much depcrated and shouldn't be used for any new projects unless you're doing a quick demo site.
The codeplex project you referenced also depends on MVC 3 (which are web applications).
You are probably better off just restarting like the tutorial says - create a new MVC application like it shows in its first screenshot.
If you do not have that option, use Web Platform Installer to add MVC for you - http://www.microsoft.com/web/downloads/platform.aspx
Good luck!
I can't tell exactly what's going on from your screenshots, but if you have a web site that you need to convert to a web application project, you can find the directions here
Although the instructions are specific to VS2005, they are basically the same for 2010 as well.

Why is global.asax missing from a Website Project

A couple of questions regarding the role of global.asax:
Why is it not included in the Website Project in Visual Studio? Are there other ways of achieving the same functionality without this file?
If I would create a Web Application project, as far as I remember, a global.asax file would be created. If I were to delete it, would the project run?
I tried to look for some explanation regarding the global.asax compilation but didn't find any info about this.. would appreciate help/links. :)
Thanks!
An ASP.NET site can run without the global.asax file. Here is a question which talks about alternatives of global.asax file.
Even if you delete a global.asax file your site will work.
Globax.asax is not required by ASP.NET for a website to run. It is, however, very useful for application-level functionality (like unhandled exception logging).
You can add Global.asax to the website project and it will work fine.
Global.asax is not added by default for web applications. If you have it, you can delete it without problems.
Be careful to include the .compiled files when deploying the website or else the events in Global.asax will not fire.
It sounds like you are familiar with Web Application Projects, now see a Web Site "project" and wonder what's going on. In any case, I'll answer as though that were true. ;-)
In Visual Studio 2005, Microsoft introduced Web Site "projects", which are not projects - they're just directory structures on a local disk, FTP site, etc. They do many things differently from Web Application Projects, and can therefore be confusing (especially if you're like me, trying to answer people's questions, not knowing which they are using).
With Visual Studio 2005 SP1, they restored Web Application Projects. If that's what you're more familiar with, then I suggest you use them. They're real projects, just like they always were.
And, BTW, there will be a global.asax, just like there used to be...

Resources