How can I open an ASP page from HTML page? - html

I am working on an asp project, its my first time uploading it to a server (a server provided at my campus)
i will have a mix of HTML and ASP pages. I want my HTML page to be my default page, while I have links on my HTML pages pointing to asp pages.
From my local machine it worked fine (of course its local. i used the localhost:XXXX address as a link, but i know it wont work when i upload to the server). I'm using visual studio 2012.
Can anyone point me to the right direction?

It might be possible that the server you are uploading to is a plain file server, and not a ASP server. If that is the case, a link to a particular ASP file would simply display its contents and not the HTML page that is generated on your local machine by your ASP server.

You should check to make sure you have ASP.NET Register in IIS.
link: https://msdn.microsoft.com/en-us/library/k6h9cz8h%28v=vs.140%29.aspx
aspnet_regiis -iru
Run this command from both of the install folders listed below (v2 & v4)
C:\Windows\Microsoft.NET\Framework\v4.0.30319
C:\Windows\Microsoft.NET\Framework\v2.0.50727
Hope this helps.

I might be misunderstanding your question completely, but...
Your IIS (web server) will have a collection of "default documents", i.e. documents it will look for if no path is provided, for example if you browse to the root of your site, such as http://tempuri.org/
What is the name of your HTML document? If it's index.html for example it should be loaded as the default. Some more info on default documents here.
Now, if you link to .html or .aspx files in your HTML doesn't matter. But if the .aspx files don't work, you should verify you have ASP.NET installed (as per answer by GlennFerrie).

Related

Vs code live server Cannot get error message

I'm currently developing a simple static web page with only HTML.
I'm using tags with href to link to different pages and the VS code live server used to work when I inserted a link like page1.html it would send the browser to this page.
But I prefer to have just the page without the .html.
When I remove the .html from the link the live server gives an error: Cannot GET /page1
But when I deploy my site on Netlify it does, however, find the page, but this breaks the development process for me.
How can I fix the live server so it also gets sent to the correct page?
Thank you in advance,
Timo
This is a common server behaviour. The server tries to find a file or folder name page1 but doesn't find it. Nothing wrong with live server. I guess Netlify is the one doing extra magic.
However if you want to remove the .html in page1 you could create a folder name page1 and put inside a index.html with the content. This way the server will find the folder named page1 and return the index.html. This will also work with live server and any standard server.
This is how your folder structure could look like:
Cannot GET /source/gfdfghdgh/A/1&2.html
This is the error I get because of the '&' symbol.
Make sure your file name is browser friendly.
VS CODE LIVE SERVER CANNOT GET ERROR MESSAGE
Restart VSCode
Sometimes the best you can do is start VSCode from scratch. First, save all of your work. Then close VSCode, which will also stop all of the extensions you've installed. Then, reopen VSCode and try again – go to the HTML file you want to view, right-click## Heading ##, and select "Open with Live Server".

How to not load Index.html?

When a website doesn't have an index.html file, the navigator displays an auto generated page right ?
Here is an example of what I mean.
This page is very handful to explore a website, but sadly it is only displayed when there is no index.html page.
Is it possible to access such a page on a website, even though index.html exists in the folder ?
I'm using Opera, but I have tried other navigators and none of the common ones seems to do what I want ^^
Thanks for reading
This is not an auto generated page. It is directory browsing of server which can be enabled/disabled through server control panel (or using .htaccess in linux servers).
When you have default document (like index.html) in a folder, the server servs the default document instead of directory browsing. So if you want to let directory browsing when you have index.html, you have to clear the index.hmtl from the list of default documents. This can be done using IIS settings (if you have access to server) or through hosting control panel in website settings (in shared hostings) (or by direct editing of web.config or .htaccess)
the navigator displays an auto generated page
No. This has nothing to do with the browser. The browser displays whatever the server returns. Nothing more, nothing less.
What you're seeing on that link is from the Apache web server. That web server is configured to (and can be configured not to) return a generated directory listing when no default response can be determined.
The "default response" might be index.html, or default.html, or literally anything that the web server is configured to look for by default. (Those are just, well, the common defaults.)
In many modern web applications the concept of a "page" doesn't even really mean the same thing, because things like MVC frameworks don't just browse directories for .html files but instead examine requested routes and generate responses from code.
Is it possible to access such a page on a website, eventho index.html exist in the folder ?
No. Because that "page" doesn't exist. The web server returned that to you because it was configured to. If it's not configured to then that data doesn't exist.

How to show list of web server files in HTML

I want to show list of all files from web server or a directory from web server into my WEB page using HTML.
I searched google a lot but didn't find anything.
Any suggestions?
Possibility 1) activate DirectoryBrowsing [aka DirectoryListing] (Apache, IIS and probably all others support this).
Possibility 2) use PHP, JSP, ASP or whatever language to make a list of the files.
HTML itself is just a markup language, so there's no possibility to do that with HTML only.

IIS 6.1 Handlers for HTML, ASP, INC files

I have a legacy website in which .HTML, .ASP, and .INC files are being used. Problem is all pages have VBScript code not parsed by IIS and thus written on page as static text. I want to fix it. All .html pages include both .ASP and .INC for scripts.
Now currently IIS Handlers are as below: all .htm, .html, .inc have IsapiModule handlers as well as ServerSideIncludeModule. This is what I suspect causing issue. So now if I remove ServerSideIncludeModule handlers and just keep IsapiModule, it parses VBScritpt correctly but HTML pages with INC inclusion do not open but ask to save a file to download. What am I missing here? This worked on my localhost fine but not on Production.
How can I fix this issue?
Thank you!
We solved this problem and posting solution so that someone reading this later can try this if it helps..
we did "Set enable 32-bit Applications to False" in Application Pool for this website and it resolved the issue. No handlers were changed while doing this.
There is an issue on client and server side code. HTML pages can read only client side code but not the server side code. Asp is a server side language and a server can read asp codes written on a .asp extension file.
So my suggestion will be try your codes in .asp files. Browsers will read the HTML codes and show you the HTML output and IIS will read the server side codes(vb-script codes)

Difference in opening a file directly and uploading to a web server

Given a simple HTML file is there any difference when testing, in opening it directly by double clicking it or uploading to IIS/Tomcat and accessing localhost/simpleHTML?
In the case of html files it dosenot matter much. Where this matters is when the page is made in languages like php, jsp etc. A webpage containing php or jsp files will not be detected by browsers when directly opened. For this we use webservers like wamp, xampp, lamp, tomcat etc and acces it via localhost/pagename. For more details just view the pagesource of a php file. You wont be able to find and php scripts in it. You will be able to see only the html part in the page. For scripting languages like html, javascript, css etc. opening directly dosent matter.
Hope this is useful to you.
No, a simple HTML-only file will not be rendered differently most(99.9%) of the time by opening it directly by double-clicking from the local file system and accessing it from a web server. The only difference will be caused if the file contains any server side language (PHP, ASP etc..)