HTML to ASP

Discussion in 'ASP General' started by Troy Jerkins, Jul 2, 2003.

  1. Troy Jerkins

    Troy Jerkins Guest

    Hi all,

    I've been struggling for hours with this one and could really use some help
    converting the code.
    The HTML portion below works exactly the way I want it to:

    <a language="vbs"
    href=vbscript:window.open("http://web/SQL/update.asp?name=somename","newwin"
    ,"height=450,width=500") >Update</a>

    I need to use this in a portion of ASP using the <% %> tags like:

    with response
    ..write "blah"
    ..write "<a language=vbs
    href=vbscript:window.open(http://web/SQL/update.asp?action=update&name=" &
    Server.URLEncode(sName) & "&key=" & sKey & ",newwin,height=450,width=500)>"
    ..write("Update") & "</a>"
    ..write "blah"

    end with

    This always generates a warning in IE stating "Problems with this web page
    may prevent it from displaying or functioning properly.....". Then a
    reference to the script.

    Line: 1
    CHAR: 17
    Error: Expected ')'
    Code: 0
    URL: <URL containing the script>

    I've tried different combo's of quotes and syntax. I've even shaved the <A>
    tag down to a simple URL only.
    ex - .write "<a language=vbs href=vbscript:window.open("http://www.go.com")
    No dice.
    .write("Update") & "</a>"

    The only thing that I can get to work is

    ..write "<a language=vbs href=vbscript:window.open()>"
    .write("Update") & "</a>"

    which opens up a blank window.

    Regards,

    --Troy
    Troy Jerkins, Jul 2, 2003
    #1
    1. Advertising

  2. Troy Jerkins

    Ray at Guest

    Your problem is with the javascript syntax then, not ASP. Or vbscript,
    rather. Try:

    with response
    ..write "<a
    href=vbscript:window.open(""http://web/SQL/update.asp?action=update&name=" &
    Server.URLEncode(sName) & "&key=" & sKey &
    """,newwin,height=450,width=500)>"
    ..write("Update") & "</a>"

    end with

    I'm not sure that I have that right, but basically, you have to have your
    url enclosed in ' or " in the resultant response.

    Ray at work

    "Troy Jerkins" <> wrote in message
    news:...
    > Hi all,
    >
    > I've been struggling for hours with this one and could really use some

    help
    > converting the code.
    > The HTML portion below works exactly the way I want it to:
    >
    > <a language="vbs"
    >

    href=vbscript:window.open("http://web/SQL/update.asp?name=somename","newwin"
    > ,"height=450,width=500") >Update</a>
    >
    > I need to use this in a portion of ASP using the <% %> tags like:
    >
    > with response
    > .write "blah"
    > .write "<a language=vbs
    > href=vbscript:window.open(http://web/SQL/update.asp?action=update&name=" &
    > Server.URLEncode(sName) & "&key=" & sKey &

    ",newwin,height=450,width=500)>"
    > .write("Update") & "</a>"
    > .write "blah"
    >
    > end with
    >
    > This always generates a warning in IE stating "Problems with this web page
    > may prevent it from displaying or functioning properly.....". Then a
    > reference to the script.
    >
    > Line: 1
    > CHAR: 17
    > Error: Expected ')'
    > Code: 0
    > URL: <URL containing the script>
    >
    > I've tried different combo's of quotes and syntax. I've even shaved the

    <A>
    > tag down to a simple URL only.
    > ex - .write "<a language=vbs

    href=vbscript:window.open("http://www.go.com")
    > No dice.
    > .write("Update") & "</a>"
    >
    > The only thing that I can get to work is
    >
    > .write "<a language=vbs href=vbscript:window.open()>"
    > .write("Update") & "</a>"
    >
    > which opens up a blank window.
    >
    > Regards,
    >
    > --Troy
    >
    >
    >
    >
    >
    Ray at, Jul 2, 2003
    #2
    1. Advertising

  3. Troy Jerkins

    Troy Jerkins Guest

    Thanks Ray!!! at work.

    That partially did the trick. I had to Encode my second variable to get it
    to work. Otherwise, I received an "Unterminated String error". Although I'm
    not sure why.
    Also, I had to surround the other parameters with double quotes
    ""newwin"",""height=450,width=500""
    Now it's working as expected.
    Thanks again!! That saves me a few more hours of aggrevation.

    -Troy

    "Ray at <%=sLocation%>" <> wrote in message
    news:...
    > Your problem is with the javascript syntax then, not ASP. Or vbscript,
    > rather. Try:
    >
    > with response
    > .write "<a
    > href=vbscript:window.open(""http://web/SQL/update.asp?action=update&name="

    &
    > Server.URLEncode(sName) & "&key=" & sKey &
    > """,newwin,height=450,width=500)>"
    > .write("Update") & "</a>"
    >
    > end with
    >
    > I'm not sure that I have that right, but basically, you have to have your
    > url enclosed in ' or " in the resultant response.
    >
    > Ray at work
    >
    > "Troy Jerkins" <> wrote in message
    > news:...
    > > Hi all,
    > >
    > > I've been struggling for hours with this one and could really use some

    > help
    > > converting the code.
    > > The HTML portion below works exactly the way I want it to:
    > >
    > > <a language="vbs"
    > >

    >

    href=vbscript:window.open("http://web/SQL/update.asp?name=somename","newwin"
    > > ,"height=450,width=500") >Update</a>
    > >
    > > I need to use this in a portion of ASP using the <% %> tags like:
    > >
    > > with response
    > > .write "blah"
    > > .write "<a language=vbs
    > > href=vbscript:window.open(http://web/SQL/update.asp?action=update&name="

    &
    > > Server.URLEncode(sName) & "&key=" & sKey &

    > ",newwin,height=450,width=500)>"
    > > .write("Update") & "</a>"
    > > .write "blah"
    > >
    > > end with
    > >
    > > This always generates a warning in IE stating "Problems with this web

    page
    > > may prevent it from displaying or functioning properly.....". Then a
    > > reference to the script.
    > >
    > > Line: 1
    > > CHAR: 17
    > > Error: Expected ')'
    > > Code: 0
    > > URL: <URL containing the script>
    > >
    > > I've tried different combo's of quotes and syntax. I've even shaved the

    > <A>
    > > tag down to a simple URL only.
    > > ex - .write "<a language=vbs

    > href=vbscript:window.open("http://www.go.com")
    > > No dice.
    > > .write("Update") & "</a>"
    > >
    > > The only thing that I can get to work is
    > >
    > > .write "<a language=vbs href=vbscript:window.open()>"
    > > .write("Update") & "</a>"
    > >
    > > which opens up a blank window.
    > >
    > > Regards,
    > >
    > > --Troy
    > >
    > >
    > >
    > >
    > >

    >
    >
    Troy Jerkins, Jul 2, 2003
    #3
  4. Troy Jerkins

    Ray at Guest

    Send me a dollar. ;P

    Ray at work

    "Troy Jerkins" <> wrote in message
    news:...
    > Thanks Ray!!! at work.
    >
    > That partially did the trick. I had to Encode my second variable to get it
    > to work. Otherwise, I received an "Unterminated String error". Although

    I'm
    > not sure why.
    > Also, I had to surround the other parameters with double quotes
    > ""newwin"",""height=450,width=500""
    > Now it's working as expected.
    > Thanks again!! That saves me a few more hours of aggrevation.
    >
    > -Troy
    >
    > "Ray at <%=sLocation%>" <> wrote in message
    > news:...
    > > Your problem is with the javascript syntax then, not ASP. Or vbscript,
    > > rather. Try:
    > >
    > > with response
    > > .write "<a
    > >

    href=vbscript:window.open(""http://web/SQL/update.asp?action=update&name="
    > &
    > > Server.URLEncode(sName) & "&key=" & sKey &
    > > """,newwin,height=450,width=500)>"
    > > .write("Update") & "</a>"
    > >
    > > end with
    > >
    > > I'm not sure that I have that right, but basically, you have to have

    your
    > > url enclosed in ' or " in the resultant response.
    > >
    > > Ray at work
    > >
    > > "Troy Jerkins" <> wrote in message
    > > news:...
    > > > Hi all,
    > > >
    > > > I've been struggling for hours with this one and could really use some

    > > help
    > > > converting the code.
    > > > The HTML portion below works exactly the way I want it to:
    > > >
    > > > <a language="vbs"
    > > >

    > >

    >

    href=vbscript:window.open("http://web/SQL/update.asp?name=somename","newwin"
    > > > ,"height=450,width=500") >Update</a>
    > > >
    > > > I need to use this in a portion of ASP using the <% %> tags like:
    > > >
    > > > with response
    > > > .write "blah"
    > > > .write "<a language=vbs
    > > >

    href=vbscript:window.open(http://web/SQL/update.asp?action=update&name="
    > &
    > > > Server.URLEncode(sName) & "&key=" & sKey &

    > > ",newwin,height=450,width=500)>"
    > > > .write("Update") & "</a>"
    > > > .write "blah"
    > > >
    > > > end with
    > > >
    > > > This always generates a warning in IE stating "Problems with this web

    > page
    > > > may prevent it from displaying or functioning properly.....". Then a
    > > > reference to the script.
    > > >
    > > > Line: 1
    > > > CHAR: 17
    > > > Error: Expected ')'
    > > > Code: 0
    > > > URL: <URL containing the script>
    > > >
    > > > I've tried different combo's of quotes and syntax. I've even shaved

    the
    > > <A>
    > > > tag down to a simple URL only.
    > > > ex - .write "<a language=vbs

    > > href=vbscript:window.open("http://www.go.com")
    > > > No dice.
    > > > .write("Update") & "</a>"
    > > >
    > > > The only thing that I can get to work is
    > > >
    > > > .write "<a language=vbs href=vbscript:window.open()>"
    > > > .write("Update") & "</a>"
    > > >
    > > > which opens up a blank window.
    > > >
    > > > Regards,
    > > >
    > > > --Troy
    > > >
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Jul 2, 2003
    #4
  5. Troy Jerkins

    VK Guest

    while u are at it may i suggest that using "with" for response.write might
    seem like a good coding practice but could cause bad performance .
    "Troy Jerkins" <> wrote in message
    news:...
    > Thanks Ray!!! at work.
    >
    > That partially did the trick. I had to Encode my second variable to get it
    > to work. Otherwise, I received an "Unterminated String error". Although

    I'm
    > not sure why.
    > Also, I had to surround the other parameters with double quotes
    > ""newwin"",""height=450,width=500""
    > Now it's working as expected.
    > Thanks again!! That saves me a few more hours of aggrevation.
    >
    > -Troy
    >
    > "Ray at <%=sLocation%>" <> wrote in message
    > news:...
    > > Your problem is with the javascript syntax then, not ASP. Or vbscript,
    > > rather. Try:
    > >
    > > with response
    > > .write "<a
    > >

    href=vbscript:window.open(""http://web/SQL/update.asp?action=update&name="
    > &
    > > Server.URLEncode(sName) & "&key=" & sKey &
    > > """,newwin,height=450,width=500)>"
    > > .write("Update") & "</a>"
    > >
    > > end with
    > >
    > > I'm not sure that I have that right, but basically, you have to have

    your
    > > url enclosed in ' or " in the resultant response.
    > >
    > > Ray at work
    > >
    > > "Troy Jerkins" <> wrote in message
    > > news:...
    > > > Hi all,
    > > >
    > > > I've been struggling for hours with this one and could really use some

    > > help
    > > > converting the code.
    > > > The HTML portion below works exactly the way I want it to:
    > > >
    > > > <a language="vbs"
    > > >

    > >

    >

    href=vbscript:window.open("http://web/SQL/update.asp?name=somename","newwin"
    > > > ,"height=450,width=500") >Update</a>
    > > >
    > > > I need to use this in a portion of ASP using the <% %> tags like:
    > > >
    > > > with response
    > > > .write "blah"
    > > > .write "<a language=vbs
    > > >

    href=vbscript:window.open(http://web/SQL/update.asp?action=update&name="
    > &
    > > > Server.URLEncode(sName) & "&key=" & sKey &

    > > ",newwin,height=450,width=500)>"
    > > > .write("Update") & "</a>"
    > > > .write "blah"
    > > >
    > > > end with
    > > >
    > > > This always generates a warning in IE stating "Problems with this web

    > page
    > > > may prevent it from displaying or functioning properly.....". Then a
    > > > reference to the script.
    > > >
    > > > Line: 1
    > > > CHAR: 17
    > > > Error: Expected ')'
    > > > Code: 0
    > > > URL: <URL containing the script>
    > > >
    > > > I've tried different combo's of quotes and syntax. I've even shaved

    the
    > > <A>
    > > > tag down to a simple URL only.
    > > > ex - .write "<a language=vbs

    > > href=vbscript:window.open("http://www.go.com")
    > > > No dice.
    > > > .write("Update") & "</a>"
    > > >
    > > > The only thing that I can get to work is
    > > >
    > > > .write "<a language=vbs href=vbscript:window.open()>"
    > > > .write("Update") & "</a>"
    > > >
    > > > which opens up a blank window.
    > > >
    > > > Regards,
    > > >
    > > > --Troy
    > > >
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
    VK, Jul 3, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Kamoski
    Replies:
    1
    Views:
    7,093
  2. Craig Kenisston

    HTML code warnings in asp.net html code view

    Craig Kenisston, Oct 7, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,088
    Martin Dechev
    Oct 7, 2004
  3. shapper
    Replies:
    1
    Views:
    10,101
    bruce barker
    Sep 10, 2008
  4. Adam Akhtar
    Replies:
    9
    Views:
    524
    Florian Gilcher
    Aug 16, 2008
  5. C. Olive
    Replies:
    1
    Views:
    258
    Chris Smith
    Oct 4, 2003
Loading...

Share This Page