ASP.NET page shows up as plain HTML-code - asp.net-2.0

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!

Related

Can't see Default.aspx file in Visual Studio

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.

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.

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.

Changing from web site to web project: issue with implementing ConfigurationSection

I am using the ASP.NET Web Site Small Business Starter Kit as a starting point for a simple web app. I wanted to convert it to a web project from a web site for few reasons (better interaction with VisualSVN, etc..). I created a new ASP.NET Web Application from scratch... then copied and pasted all the files via explorer, then did project->create web application. There was some initial errors that I fixed, but now I get this on the original 'items' page:
An error occurred creating the configuration section handler for SmallBusinessDataProviders: Type 'FooWeb.ProviderSettingsValidation' does not inherit from 'System.Configuration.IConfigurationSectionHandler'. (C:\Projects\FooWebFacing\FooWeb\FooWeb\web.config line 5)
Does anyone know why it's giving me this error message that I have to implement IConfigurationSectionHandler? It worked without issue in the ASP.NET Web Site project by just inheriting from ConfigurationSection... And that website was build as .NET 3.5. I tried changing my project to even .NET 2.0 but still no luck - but I don't see how that matters anyway. I am using VS 2008 Developer Edition. Thanks very much for any help.
EDIT: Just to be clear: the same exact code works fine as a web project - but not as a web application. This error makes no sense at all either, regardless of what project its from. Does anyone have any clue how this could happen?

asp:Menu Not working on webhost

I'm using Visual Studio Web Express 2008 to develop an ASP.Net website. I have a master page that every page inherits from and on that master page I have the asp:menu control. On my local machine the menu control works just fine. The javascript is emitted and the links work as well.
However, when I upload it to my webhost service provider, the javascript is not emitted and my links do not work. I'm getting a feeling that my service provider really doesn't know much about .Net as they suggested that I make sure that I upload the .js files which isn't necessary.
Does anyone have any suggestions that I can give them? They're asking me what requirements are needed. It seems to me that something is not setup on their server properly but according to them, they have .Net 3.5 SP1 installed.
Everything for the control should be in the framework (no extra steps necessary); make sure in IIS they set it up to use the 2.0 version of the framework (which is probably the case)...
The cases of errors where I've seen that is when the framework isn't installed.
there is an http debugging tool called fiddler that will help you to see what is going wrong with the menu and related site resources. See the requests those are returing 404 and it will help you a lot to head towards the solution faster

Resources