RegisterClientScriptInclude and more

D

Dunc

Hi,

I've got an ASP.NET 2.0 app, and I'm trying to incorporate Google Maps.
The app uses nested master pages, so it seems the only way to add a
<script> tag to the header block is to use
ClientScript.RegisterClientScriptInclude.

The problem I'm having is the script is automatically URLencoding the
script I'm trying to pass, so the ampersands are being lost and
replaced with &amp; which appears to stop the script from working
correctly.

Is there a way to turn off the URL encoding, or another way to do this?


The current code I'm using is:
ClientScript.RegisterClientScriptInclude(this.GetType(), "script",
"http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABCDEF");

On another note, I've had to register a client script block with
"<script>onload='load();'</script>" instead of modifying the <body> tag
to include a <body onload=""> function. It'd much rather use a body
onload, does anyone know the command to do this?

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top