Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > HTML to ASP

Reply
Thread Tools

HTML to ASP

 
 
Troy Jerkins
Guest
Posts: n/a
 
      07-02-2003
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





 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      07-02-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
>
>



 
Reply With Quote
 
 
 
 
Troy Jerkins
Guest
Posts: n/a
 
      07-02-2003
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%>" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >
> >
> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      07-02-2003
Send me a dollar. ;P

Ray at work

"Troy Jerkins" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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%>" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      07-03-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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%>" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >
> > >
> > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET MVC - Html.RenderPartial and Html.RenderAction shapper ASP .Net 1 09-10-2008 03:29 PM
firefox html, my downloaded html and firebug html different? Adam Akhtar Ruby 9 08-16-2008 07:55 PM
HTML code warnings in asp.net html code view Craig Kenisston ASP .Net 3 10-07-2004 04:05 PM
how to redirect to a frames-based html page and load the right html when coming from an ASP.NET page Mark Kamoski ASP .Net 1 08-13-2003 05:51 AM



Advertisments