Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Spot the difference

    I'm trying to design a new site containing ASP code. However it seems I'm being stopped at the first hurdle...

    See this html page:

    http://www.mike.watts.name/home.htm

    And now see the same page in ASP:

    http://www.mike.watts.name/home.asp

    Using exactly the same code, the HTML page looks the way I want it to but obviously the ASP code isn't being parsed. In the ASP page however, the header is smaller and the table heights aren't having any effect.

    Is this due to browser / server / or just the way ASP works?

    Any help on this would really be appreciated.

  • #2
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    what is exactly wrong?
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #3
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by A1ien51
    what is exactly wrong?
    Like I say the table & cell heights (100%) are being ignored in the ASP version but not in the HTML version.

  • #4
    Regular Coder
    Join Date
    Aug 2003
    Posts
    565
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Welcome!
    maybe could you show us some code?

  • #5
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by bouchel
    Welcome!
    maybe could you show us some code?
    Right click the page and go to 'view source' there's no ASP code controlling the height of the table, that code is exactly the same as the html one. However the same code with a .asp extention makes it ignore the table height.

    The two links I pasted are exactly the same page, I just copied and changed the extention of the file to show the difference in the way the pages are being treated.
    Last edited by mikewattsuk; 12-15-2003 at 12:29 AM.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    I didn't see any difference. Both tables resize to 100% as I resize the window.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #7
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    I get two different pages. The heading is a different size on each, and the positioning/sizing is different too. They cannot possibly be the same page source!!

    Remove all the ASP from the ..HTM page and copy it to .ASP then let us know.
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"

  • #8
    Regular Coder
    Join Date
    Aug 2003
    Posts
    565
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by mikewattsuk
    Right click the page and go to 'view source' there's no ASP code controlling the height of the table, that code is exactly the same as the html one. However the same code with a .asp extention makes it ignore the table height.
    well I mean... you could post the code here
    Last edited by jeskel; 12-15-2003 at 01:24 PM.

  • #9
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by M@rco
    I get two different pages. The heading is a different size on each, and the positioning/sizing is different too. They cannot possibly be the same page source!!

    Remove all the ASP from the ..HTM page and copy it to .ASP then let us know.
    OK, here are the two pages without any ASP code in them at all.

    http://www.mike.watts.name/home2.asp

    http://www.mike.watts.name/home2.htm

    Now this really doesn't make any sense to me as both pages are now displaying incorrectly (the table should fill the page). This could be an HTML issue but then I've tried all commands I can and CSS but nothing affects the height.

    The ASP code that was in the page was:

    Line 1: <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    Line 9-45:

    <%
    Dim sPath, filesys, count, getValue, update, twohrs

    sPath = Request.ServerVariables("Path_Translated")
    sPath = Left(sPath,InStrRev(sPath,"\")) & "counter.txt"

    Set filesys = CreateObject("Scripting.FileSystemObject")

    Set getValue = filesys.OpenTextFile(sPath,1,0)
    ' get the current value
    count = getValue.ReadLine
    If Request.Cookies("mikewattsname")("recentvisitor") <> "yes" Then
    ' increment by 1 before displaying, 'cos they're a newbie
    count = Int(count) + 1
    End If
    ' close file
    getValue.Close
    If Request.Cookies("mikewattsname")("recentvisitor") <> "yes" Then
    ' only update the value in the text file if they're a newbie

    ' overwrite old text file with new one
    Set update = filesys.CreateTextFile(sPath)

    ' put new value in text file
    update.WriteLine(count)
    update.Close

    ' give them a cookie to make sure it doesn't count them more than once
    Response.Cookies("mikewattsname")("recentvisitor") = "yes"
    ' make it expire in 2 hours' time
    twohrs = DateAdd("h", 2, Now)
    Response.Cookies("mikewattsname").Expires = twohrs

    End If
    ' put a comma in the number
    count = FormatNumber(count, 0, 0, -1, -1)
    %>

    Line 71: <td align="center" height="100" valign="middle" bgcolor="#CCFFFF"><p align="center">Visitors <%=count%></p>

    And that's it for the ASP code. Now, I'm totally confused on this as you can imagine Any ideas would be appreciated.
    Last edited by mikewattsuk; 12-15-2003 at 01:18 PM.

  • #10
    New Coder
    Join Date
    Nov 2003
    Posts
    65
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I can see what you are saying, the pages do have identical markup.

    The ASP file has a little ASP code to update a text based hit counter and then display the value.

    If you view the source of the HTML page you can see the ASP code. Once it is removed the two pages are identical.


    Unfortunately I have no idea why!

    I will say though, if you are using CSS then you should get rid of the inline styling you have.

  • #11
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    OK case closed, I worked it out!

    Maybe someone can enlighten me on the answer however, I had to remove the line:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    and then the page was treated correctly. This line was added by Dreamweaver. However, it seems to stop any table heights being affected.

  • #12
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    try height="100%"
    I am the luckiest man in the world

  • #13
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Originally posted by Roelf
    try height="100%"
    Line 71: <td align="center" height="100" valign="middle" bgcolor="#CCFFFF"><p align="center">Visitors <%=count%></p>

    This was supposed to be height 100, it's the footer.

  • #14
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by mikewattsuk
    OK case closed, I worked it out!

    Maybe someone can enlighten me on the answer however, I had to remove the line:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

    and then the page was treated correctly. This line was added by Dreamweaver. However, it seems to stop any table heights being affected.
    That is a dtd (Doctype Declaration) which essentially tells the browser how to interpret and display the markup.
    Omnis mico antequam dominus Spookster!

  • #15
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    I suspect that the DTD was telling IE to render one way, but then it was encountering the <% %> tags in your HTML page, and therefore switching to another HTML rendering model. Without the tags there's no conflict between what your DTD is telling and what your code is presenting to the browser, and so both documents render identically. Fix your HTML source so that the document renders as you desire, then add the ASP back in and rename to ASP. Assuming your ASP makes no changes to the output delivered to the browser, then the page will display exactly the same as it did before.
    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •