Forum Moderators: open

Message Too Old, No Replies

asp to html

asp to html

         

meanweaver

11:19 pm on Jan 22, 2004 (gmt 0)

10+ Year Member



I am just taking over a site which has been emailed to me. When I open the site all pages end with the extension .asp I know nothing about asp and if i do try to open the pages in my browser the background not correct, I understand this is something to do with how asp works, however i dont expect to understand asp in a week but so is there an easy way to convert it to html.
As far as i can see i will have to make up a similar looking page in html and then copy all the content across to my new pages, does anyone have any easier ways of doing this, there are 30 pages.
Cheers Ian

Purple Martin

12:00 am on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ASP is a server-side script: it gets executed by the web server BEFORE the web page gets sent to the user's browser. Therefore ASP is used to change what's on the page. If you just copy out all of the HTML, you'll lose the functionality that the ASP was giving to the site. So here's what you need to do:

Turn your PC into a web server so that the ASP executes properly (the background will look correct and everything else will work). The quick way to do this is with Personal Web Manager or IIS - your PC should already have one or the other, but they'll need activating or installing from the Windows CD or something like that. There are help pages and web tutorials that give step-by-step instructions.

Once you've got it working, you'll be able to examine the ASP code to see why the pages do what they do. This is a great opportunity to teach yourself a server-side language!

meanweaver

7:24 am on Jan 23, 2004 (gmt 0)

10+ Year Member



That does sound very interesting, but this things got to be up in a week and i need to make some changes, i can view the pages fine if i do page preview with Dreamweaver, i was looking at doing a html version for now and getting my head around the asp later, but if i set the pc up as a server will it take a lot of working out do to the modifications on the site, Im not sure if this sounds like something you can do without one to one tuition.
Regards Ian

brucec

9:24 pm on Jan 23, 2004 (gmt 0)

10+ Year Member



Hi Ian, I am new to Webmaster World, but I love ASP coding and have entire web sites in it. So, let me offer a quick solution.

Let me also point out before I get into the ASP, that the background may not come from ASP at all. It can also be entered through an external cascading stylesheet or otherwise, CSS. I will explain that below too for you.

If the web server where the web site needs to be supports ASP, then you can simply go to View Source in Internet Explorer and look at the HTML which was generated by the ASP on the web server.

Now, you can copy the HTML from the page source. Since the background is generated by ASP, you will of course need to make small adjustments to the HTML and manually code the background attribute of the HTML.

Just keep in mind that ASP can execute plain HTML if it is outside of the ASP identication code which is <% and %> - The percent mark and the opening or closing HTML brackets is the symbol that lets the web server know it is dealing with ASP and not HTML. Anything outside of the percent marks is plain HTML. This is how an ASP programmers tells the server to process ASP or HTML.

Since the background is not showing up, the previous designer probably had something like

<% response.write "<body background=WHATEVER.GIF>" %>

If that is the case, then you can change the URL of the background to whatever you want.

You can simply right click on the live web page and get the URL of the background image and code yout HTML manually with it.

Also, check to see that there is not an external style sheet by looking in the <HEAD> tags of the HTML. You may have to download the external cascading stylesheet if there is a <LINK rel="stylesheet"> tag.

Well, this should get you going in the right direction. Let me know if you need further help.

meanweaver

10:25 pm on Jan 25, 2004 (gmt 0)

10+ Year Member



Hi Bruce and thanks for your reply.
What you have said makes total sence, i understand Basic html amd have a simple external css with another site, I have taken a closer look at the site files i have been sent, there is an external style sheet, and when i open the asp pages in I.E the main thing missing is the navigation table down the left hand side, I am totally at a lose to how this has been done as there is no <link rel= in the head of the pages and i have checked though the code and cant see %something% anywhere either, However i would love to be able to work this out as just having to change the navigation table once and having it called into the page will save huge amounts of work, the site is not currently live, it was but for certain reasons the guy doing the upkeep has passses it on but it now needs new content and putting back online, long story but i am now the webmaster and have only dealt in html before now. The site was zipped an emailed to me along with all the sub folders and flash animations, the navigation table is in one of the subfolders in .txt format. Is there a way of useing css to call a table with links into a page maybe by giving it a class id. THis is new to me if there is. Any other advice you can give me with this would be gratefully received.
Regards Ian

brucec

5:05 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Sorry, Ian, for not getting back to you sooner. Maybe the left nav bar is done with Javascript. Check for a <script language="javascript" src="WHATEVER.JS"></script>

If this is the case, then you can modify the javascript. I do this all my web sites, because it allows you to make one change and replicate the HTML onto all pages without editing more than one file.

brucec

5:08 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



You asked about using CSS to call in the .txt file. CSS cannot do that as it is for formatting only.

If the nav bar is in an external .txt file, it could be called in with the ASP, because ASP can read and write external text files. So, look in the ASP code for the name of that .txt file. Then, all you really need to do is change the txt file.

Shadows Papa

5:50 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Things to look for - references to "outside files", lines like "include" (meaning the server is to grab the contents of another file and place the content where the include line is), scripts - which can be called or "included" from external files.
I suspect you may not have the whole thing, and if you do, the "directory structure" may not be intact. You could have all files, but if a background was called from a folder /pictures/background.gif and you have it in the SAME folder at the "asp" file, it can't find it to display it.
Be sure structure is intact, not just that you have all files you are supposed to have.
ONE reason I use ASP is so that I can maintain ONE single menu file, display it on 40 pages and when I need to change the menu or a link, I change the one menu.inc file, not all my pages.
Another is that I build some pages based on database content, such as a guestbook. That page is only a handful of html lines, the server creates it by pulling data from a file, and building a table with the guestbook entries on the fly. If you look only at the html or ASP file, you'd get nothing at all but a blank page.

Probably not much help, but I'm an ASP beginner myself.

Shadows Papa

meanweaver

6:08 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Been having another look at the code that calls in the menu and i think you right about the Java script, I opened a page up in Dreamweaver and where the menu should be was the little symbol dreamweaver associates with javascript, in the table cell where the menu should be was this

<!-- #include file="includes/menu.inc" -->

Now as far as i am aware that is just a comment in html, but does the # sign mean something in asp, I have looked though all the pages and this comment is in the code on every page in place of the menu, there are no Script tags on the pages at all. So i guess what looks like a html comment to me must mean something in asp.

You mentioned being able to call a table into a page with javascript, think this might be getting a bit side tracked but right now on my other site i have to edit the menu on 15 pages everytime i add or change a page, but I'll find out more about that once i work out how this site i have inherited works.

Thanks again Ian

meanweaver

6:16 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Forgot to mention Bruce that i should have the complete site, inside the main folder in an includes folder images ect, You say your new to asp yourself but are you learning it from home or college, currenty doing a c&g level 3 at nightschool here which is fine for basic site structure and html but it doesn't go far enough for things like asp and the only javascript is for rollovers, Thanks for your help so far.

SuzyUK

6:31 pm on Jan 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<!-- #include file="includes/menu.inc" -->

bingo! that's the SSI (server side include) call which grabs a file called menu.inc which is in the includes subdirectory and inserts it into every page.

It's not javascript, nor is it vbScript but it is where the ASP comes in.

if you want to convert the site back to HTML you will have to take the code in the file named menu.inc and paste it back into every page before saving it as .htm..

but if I can help persuade you instead of the time it's take you to all these pastes if you use that time to learn about SSI and that if all you ever do is have an asp site for the reason that you can use includes (and therefore templates) then do it.. it'll be worth it

you can build a very simple templated site (no need to rebuild your existing site) just by using includes and without the need to learn any scripting language just yet..

Suzy

brucec

6:54 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



LOL. Ian. I said I was new to Webmaster World, not ASP. I have been using ASP for 3 1/2 years.

You mentioned the HTML comments, but those comments are only for older web browsers who do not understand what #include is.

Like Papa Shadow said above, the #Include is to call in external ASP files. If you edit it, you may be able to change the nav bar. Also, make sure your directory struture is the same as the one on your web server or you may not see the files. Like Papa S. said above, it cannot be intact.

meanweaver

11:29 pm on Jan 26, 2004 (gmt 0)

10+ Year Member



Thanks all things are slowly coming together, ok I now get the bit where the <!-- #include file="includes/menu.inc" --> is calling the menu onto the page, the menu.inc is indeed in a sub folder called includes this i now understand, what though me was how short that code is.
Now if this is the only asp code on the site i must be missing something or this part of asp is easier than i thought.
If this is so, then all i have to do is give my pages the .asp extension create a folder called includes then where i want menu's headers ect i just put the code <!-- #include file="includes/whateverfile.inc" --> and thats it.
I feel i must be missing something here or is that all i need to know just to call menus ect into a page.

Cheers Ian

meanweaver

9:45 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



Ok have just tried to upload this asp site to a server in place of my own site for my own education, and for some reason i get the 403 error, i have checked the sub folders and everthing seems to be there, Am i meant to upload some asp code to another folder or does the server no what to do when it sees the asp extension.

Also can someone give me a step by step guide in any format on how to call the navigation menu onto a page to save me altering every page when I make alterations to it.
Final question, learning about asp and ssi sounds like the next step for me, can anyone give me a good site from which to learn with tutorials ect, or even good books to buy for a total beginner or does anyone know of good college courses, I am in the uk.

Thanks again Ian

Shadows Papa

3:12 am on Jan 28, 2004 (gmt 0)

10+ Year Member



Ian,
That part of ASP is simple, and it's mostly what I do with it. IT makes for simple site upkeep to put commonly used things in a file that's used by multiple pages. There are other MUCH more complex things you CAN do with it, but you can have an ASP page that is absolutely that darned simple.
If you can't access it properly now, it's perhaps that server won't serve up asp. Not all servers will - Mickysoft servers running IIS 5 or greater will - please anyone correct me if I'm wrong!
Others will if they run the software to serve ASP pages. Mickysoft servers can also serve up PHP if the software is running on them to do so.
If you put ASP pages on a server that isn't able to understand or run ASP, it won't fly. Not all servers have it enabled. You might check by creating a VERY simple HTML page, as simple as you want, and simply renaming it to MYPAGE.ASP and see if the server will serve it to you.
(www.mydomain.com/mypage.asp for example)
If not, the server can't handle ASP.

Shadows Papa

meanweaver

12:06 am on Jan 29, 2004 (gmt 0)

10+ Year Member



You seem to have hit the nail on the head again with regards the server not being able to use asp, the reason is they are Rehat Linux and FreeBSD operating systems. I was advised to use php instead, but thats another kettle of fish!

so what about this, i have been doing some homework and have read this, to call the navigation table onto the page i out this code where i want it to appear

<--#includes file="myfilename.htm"-->

and so that the server knows the page contains an ssi i just need to give it the extension .shtml

Well this is new to me and i have not tried it yet but if it is this simple will it work on Rehat Linux and FreeBSD operating systems.
Cheers Ian

meanweaver

12:28 am on Jan 29, 2004 (gmt 0)

10+ Year Member



Just a quick update, I just tried getting the include command to work by giving the page an shtml extension but no luck arrgghh! I gace the includes file the extension html as per the books instuctions but no luck!

Anyone no where i am going wrong.