![]() |
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 |
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 > > > > > |
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 > > > > > > > > > > > > |
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 > > > > > > > > > > > > > > > > > > > > > |
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.