Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
I'm not sure to understand...can you give me an example or give me a link?
Thank you!
Copy link to clipboard
Copied
>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 %>