Results 1 to 5 of 5

Thread: Urgent: ASP WriteLine method - Writing ASP?

  1. #1
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro

    Exclamation Urgent: ASP WriteLine method - Writing ASP?

    Hi peeps, I've had this mini project dumped on me seriously "last minute" late,

    I need to create a mini content management page for crafting some of our product pages.

    Basically it's a little tool which someone can use to insert copy & pasted data into a form, it then uploads to a database (for any editing purposes after the fact - saves them copy & pasting all the data again), and finally (the bit I'm having problems with) outputting the information out to a static html page.

    Now, most of it is pretty straight-forward, the only issue I'm having is out putting the static page from the database fed data.
    I'm using the WriteLine("") method to write the lines of code out to the static files, now most of it is fine, apart from a few places where the ASP needs to output ASP code into the static (ish - it's tracking information code related to our mainframe) page.

    Obviously the script comes across the asp tags, then complains.

    Is there an easy way to output the asp code in the strings, possibly using concatenation and something similar to VBcrlf?

    Any help would be much appreciated
    (\__/)
    (='.'=)
    (")_(")

  2. #2
    Pixel Abuser Spunkey's Avatar
    Join Date
    Nov 2003
    Location
    Milton Keynes
    Posts
    1,523
    Thanks
    0
    Thanked
    0 times in 0 posts
    I assume by ASP code you mean ASP variables? If so this should work below...

    Code:
    <html>
    <head>
    ...
    </head>
    
    <body>
    <%
    dim iNumber 
    dim szString
    
    iNumber = 1000
    szString = "Monkeys"
    
    ' Open FSO and your text file..
    FSO.WriteLine("I have" & iNumber & " " & szString & " living in my garden")
    %>
    </body>
    </html>
    All you have to remember is that anything between the " "s is string data, and anything outside of them is ASP. The & is used to stick the two together.
    In the example above, the text in your file would read -
    I have 1000 Monkeys living in my garden.

    HTH!

  3. #3
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro
    Nope, that's not it, but I just found what I was looking for

    Code:
    act.WriteLine("<input type=""hidden"" name=""brochure_year"" value=""" & Chr(60) & Chr(37) & "=request(""brochure_year"")" & Chr(37) & Chr(62) & """>")
    That's what I was trying to do
    (\__/)
    (='.'=)
    (")_(")

  4. #4
    Pixel Abuser Spunkey's Avatar
    Join Date
    Nov 2003
    Location
    Milton Keynes
    Posts
    1,523
    Thanks
    0
    Thanked
    0 times in 0 posts
    ahhhh

    yeah it gets really confusing when you need to put " in a string you want to output - you end up with """s everywhere and its a complete nightmare to debug if it ever goes titsup

  5. #5
    Sublime HEXUS.net
    Join Date
    Jul 2003
    Location
    The Void.. Floating
    Posts
    11,819
    Thanks
    213
    Thanked
    233 times in 160 posts
    • Stoo's system
      • Motherboard:
      • Mac Pro
      • CPU:
      • 2*Xeon 5450 @ 2.8GHz, 12MB Cache
      • Memory:
      • 32GB 1600MHz FBDIMM
      • Storage:
      • ~ 2.5TB + 4TB external array
      • Graphics card(s):
      • ATI Radeon HD 4870
      • Case:
      • Mac Pro
      • Operating System:
      • OS X 10.7
      • Monitor(s):
      • 24" Samsung 244T Black
      • Internet:
      • Zen Max Pro
    yeah, every time I was trying to write a line it kept hitting the asp tag that was part of the string and making a right mucking fess

    Never mind, solved now
    (\__/)
    (='.'=)
    (")_(")

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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