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)
Related
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".
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).
I have a situation that I was wondering if someone can help me out with. I have a webpage that displays properly most of the time. Sometimes however (and this is rare), it does not apply the .css file and just dumps the data out on the screen. It looks like the .css is not loading. Is there a way to get the .css to load before the actual html so that this does not happen? Any ideas on how to best proceed on this?
Thanks
There is a possibility that server is returning 404 on CSS path. Download fiddler or monitor it using Web Developer Tools (Network).
You need to load the CSS in before body actually starts. There might be an issue with your server. It might be returning 404 request while getting CSS from server. You can contact server (hosting) administrator for the same.
Check the IIS settings and rights on the 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..)
In page.html we can use javascript code, I accept that, but can we use jsp and tld files in html files.
Please explain.
Any server-side code would need to be executed on the server, not in the browser. There's a hard separation between the server-side processing and the client-side processing. So the JSP code wouldn't be able to interact with the JavaScript code or anything like that.
In order for server-side code to be executed in an HTML file before rendering it to the browser, your server would need to be configured to process that code. It would be a matter of configuring your web server, whichever one you're using. By default I imagine it just returns .html files to the browser without any server-side processing. But you can configure your web server to treat .html files just like it would JSP files.
Keep in mind that you would need to treat those .html files like you normally would JSP files. It would have to match the same conventions for separating client-side code from server-side code.
If you configure your web server to map the text/html content type to JSP, you can.
No. JSP pages are executed on the server side and produce HTML, which is sent to the browser. JSP acts just like PHP in this regard, essentially "rendering" some HTML code and sending it off to the user. You can't embed JSP code in the HTML and send it off to the user - their browser will just do nothing with it.