standalone asp.net page - asp.net

i want to test my web hosts asp.net capabilities - equivalent to a 'phpinfo' page - is there a standalone aspx page I can upload to test that asp.net is correctly running and what version etc it is running.
Thanks,
Josh

As Cody said, a blank default.aspx page should work, but I recommend enabling tracing for the page as well to get some more useful information about your host's ASP.NET setup ie
<%# Page Trace="true" %>
MSDN Doc

Can you just make a blank default.aspx page with nothing but <% Response.Write("Hello World") %> in the source.?

Related

Modifying code in a website on IIS

I have a basic ASP.NET website running under IIS. I didn't publish it, so it's not precompiled or anything.
I was under the impression that if I modify any of the code under any *.aspx.cs file, the site would compile just-in-time and be updated to show those changes.
However, that's not the case. It doesn't reflect my changes and still runs the old code which is in the websitename.dll under the bin folder. Removing that file throws an error.
Is there a way to dynamically modify and run code in an IIS website?
EDIT: the .aspx files do reflect any modifications, it's the .aspx.cs that doesn't work.
It appears that your site is an ASP.NET web application instead of a website. Look at the .aspx file.
In a web application it looks like this:
<%# Page Language="C#" CodeBehind="Default.aspx.cs" Inherits="WebApplication._Default" %>
In a web site it looks like this:
<%# Page Language="C#" CodeFile="Default.aspx.cs" Inherits="_Default" %>
So if your aspx contains CodeFile directive, changes to the code behind will be dynamically picked up.
If it is a web application, you can get rid of the code behind files and any changes would require recompilation.

Parser Error Message: The file '/Site1.Master' does not exist --- but it does

Seems like an easy-to-fix error, but I've been banging my head on this for a while. App works fine in the VS built-in webserver, but not after moving it to the dev server with IIS7.
The default.aspx file refers to the master page in the page directive...
<%# Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MyApp.Default" %>
Site1.Master is in the site's root directory, along with default.aspx. The folder permissions are read to Everyone at this point.
This is an intranet site so IIS authorization is anonymous disabled, windows auth enabled, impersonation enabled. App pool is .NET v4, managed pipeline integrated.
I've looked through this site and others for answers and while others have had the same problem, it was for different reasons.
Thanks.
I had the same issue when we moved our site from one server to another. Our new site is on a VPS at a good hosting company (SoftSysHosting.com) and their tech support created a virtual directory of to where our website/app is. That solved it!
I could solve this issue by removing the CodeFile="..." Option in the first line in the Site.Master:
<%# Master Language="C#" AutoEventWireup="true" CodeFile="Site.Master.cs"
inherits="CG.PresentationLayer.WA.MasterPage" %>
into:
<%# Master Language="C#" AutoEventWireup="true" Inherits="MyApp.MasterPage" %>
I have had a similar issue before. The underlying problem is that I assumed that the paths would stay the same and they did not. Log into your dev server and navigate to your master page. Open the page's properties in Explorer and view the path. Now in a test page on your application run a HttpRuntime.AppDomainAppPath() and view where the app is running from. From there you can see where the mismatch is taking place.
Suppose if you are having the root dir of your website or webapplication as given in the pic like "WebApplication1". This is your root folder of the site.
So just copy and paste the content inside the root folder "WebApplication1" to the "root folder" "/" of the FTP address.
Not: dot not copy with root folder WebApplication1. just copy the content inside the root folder.
Your Dir Structure
==+WebApplication1
====Properties
====Referance
====PropertiesSite1.Master
====Web.config
====Webform1.aspx

Response.write with classic ASP page on IIS7

The following statement will not work with a classic asp page on an IIS7 website
<% Response.Write("test") %>
Have you enabled ASP inside Windows features?
I figured out that it had to do with adding a handler mapping for server side includes. When I added a module mapping ServerSideIncludeModule with request path of *.asp, it broke my site.

Web Deployment

We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening
In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine.
We made some code changes to the .cs file. Say for example, we added a button and added the event handler to the button.
This new functionality was not getting executed properly.
We changed the codebehind directive to codefile directive
Now it is working fine. But during deployment, it asks that the .cs file also be deployed along with the aspx page. We are not sure why this is happening.
I have attached an example page directive
In VisualStudio with CodeFile
<%# Page language="c#" Codefile="ePC.aspx.cs" AutoEventWireup="True" Inherits="SPUniversal.Web.ePC" %>
After publishing the website
<%# page language="c#" autoeventwireup="True" inherits="SPUniversal.Web.ePC, App_Web_eu_mdesx" %>
The App_Web_eu_mdesx got generated automatically in the published website. I don't understand what is going on here. Can you explain?
For 2.0 sites, you have several options of how ASP.Net handles your web site. You can use default compilation, or pre-compiled sites. If you use default compilation, you need to have the source files on the server because inn this mode, ASP.Net will re-compile the website dynamically if it detects any changes to any of the source .cs or .aspx files.
You may want to look into the pre-compilation options available. By pre-compiling your site when you deploy it, you won't necessarily have to put the .cs files on the server.

Asp.net 1.1 to 3.5 migration problems

We had an asp.net 1.1 application that we recently migrated to 3.5. We are facing some problems when we do code modification on the migrated application. Here is what is happening
In the asp.net 1.1 application we have the page directive codebehind="ePC.aspx.cs". This migrated fine.
We made some code changes to the .cs file. Say for example, we added a button and added the event handler to the button.
This new functionality was not getting executed properly.
We changed the codebehind directive to codefile directive
Now it is working fine. But during deployment, it asks that the .cs file also be deployed along with the aspx page. We are not sure why this is happening.
I have attached an example page directive
In VisualStudio with CodeFile
<%# Page language="c#" Codefile="ePC.aspx.cs" AutoEventWireup="True" Inherits="SPUniversal.Web.ePC" %>
After publishing the website
<%# page language="c#" autoeventwireup="True" inherits="SPUniversal.Web.ePC, App_Web_eu_mdesx" %>
The App_Web_eu_mdesx got generated automatically in the published website. I dont understand what is going on here
If you created the new 3.5 app as a Web Site instead of a Web Application, that could be causing what you see.
Take a look at this old blog post that explains some of the differences here:
Web Site vs. Web Application
I don't think I fully answered your question, but hopefully these breadcrumbs will lead you down the right path.
To add to what CubanX said, even if you did create it as a Web Application (rather than a Web Site), it can still be worth right-clicking your Web Application Project in Visual Studio's Solution Explorer and clicking "Convert To Web Application", even though it already is one.
We found this fixed a few mysterious problems for us - we never figured out why though. :)

Resources