Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   HTML to ASP (http://www.velocityreviews.com/forums/t788155-html-to-asp.html)

Troy Jerkins 07-02-2003 04:12 PM

HTML to ASP
 
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 07-02-2003 04:20 PM

Re: HTML to ASP
 
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" <tjerkins@alltel.net> wrote in message
news:OqmAMTLQDHA.2460@TK2MSFTNGP10.phx.gbl...
> 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 07-02-2003 05:16 PM

Re: HTML to ASP
 
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%>" <ask@me.forit> wrote in message
news:euznKXLQDHA.2852@tk2msftngp13.phx.gbl...
> 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" <tjerkins@alltel.net> wrote in message
> news:OqmAMTLQDHA.2460@TK2MSFTNGP10.phx.gbl...
> > 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 07-02-2003 05:22 PM

Re: HTML to ASP
 
Send me a dollar. ;P

Ray at work

"Troy Jerkins" <tjerkins@alltel.net> wrote in message
news:uiWwp2LQDHA.3768@tk2msftngp13.phx.gbl...
> 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%>" <ask@me.forit> wrote in message
> news:euznKXLQDHA.2852@tk2msftngp13.phx.gbl...
> > 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" <tjerkins@alltel.net> wrote in message
> > news:OqmAMTLQDHA.2460@TK2MSFTNGP10.phx.gbl...
> > > 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 07-03-2003 11:37 AM

Re: HTML to ASP
 
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" <tjerkins@alltel.net> wrote in message
news:uiWwp2LQDHA.3768@tk2msftngp13.phx.gbl...
> 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%>" <ask@me.forit> wrote in message
> news:euznKXLQDHA.2852@tk2msftngp13.phx.gbl...
> > 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" <tjerkins@alltel.net> wrote in message
> > news:OqmAMTLQDHA.2460@TK2MSFTNGP10.phx.gbl...
> > > 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
> > >
> > >
> > >
> > >
> > >

> >
> >

>
>





All times are GMT. The time now is 03:03 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57