Skip to main content
Known Participant
May 26, 2010
Question

Goto Detail Page to PopUp Window

  • May 26, 2010
  • 1 reply
  • 449 views

I have a page with a repeat region in ASP VBScript. I want to use a Goto Detail Page but to open a PopUp Window with Javascript. This doesn't work for me, as it always goes to the first record:

<script>
function opencalinterval(){
var popurl="/en/calcenter/equipment/edit_calinterval.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & rsAssets.Fields.Item("id").Value %>"
winpops=window.open(popurl,"","width=600,height=500,scrollbars,")
}
</script>

It works if I use it on a regular hyperlink like this:

<a href="/en/calcenter/equipment/edit_calinterval.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "id=" & rsAssets.Fields.Item("id").Value %>">change</a>

This topic has been closed for replies.

1 reply

Participating Frequently
May 26, 2010

I think that because you are withing javascript tags, it is not parsing the asp tags. You need to concatenate the string literals with the dynamic asp tags.

BracholeAuthor
Known Participant
May 26, 2010

I'm not sure to understand...can you give me an example or give me a link?

Thank you!

Participating Frequently
May 26, 2010

>I'm not sure to understand

Javascript will interpret everything between the quotes are string literals, so the server side code will not execute. Try:

var popurl="/en/calcenter/equipment/edit_calinterval.asp?" + <%=  Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) &  "id=" & rsAssets.Fields.Item("id").Value %>