Saturday, March 24, 2012

Mapping a Url Using ~

I need to generate client-side JavaScript from server-side ASPX. I have no
trouble doing that but in the JavaScript I generate, I need to refer to a Ur
l
of another page on the site when doing JavaScript that pops a window
(window.open()).
In the server side code, I want to be able to convert a Url which contains a
"~" into a Url which I can then insert into the client-side JavaScript. What
function can I use to dynamically convert a path which contains a "~" into a
path that can be used from the client? This must be possible because it's
what controls like the server-side IMG tag use for their Src property.
Thanks.Control.ResolveClientUrl (also Page.ResolveClientUrl) is the helper API in
2.0 for this.
-Brock
http://staff.develop.com/ballen

> I need to generate client-side JavaScript from server-side ASPX. I
> have no trouble doing that but in the JavaScript I generate, I need to
> refer to a Url of another page on the site when doing JavaScript that
> pops a window (window.open()).
> In the server side code, I want to be able to convert a Url which
> contains a "~" into a Url which I can then insert into the client-side
> JavaScript. What function can I use to dynamically convert a path
> which contains a "~" into a path that can be used from the client?
> This must be possible because it's what controls like the server-side
> IMG tag use for their Src property.
> Thanks.
>
SHWEET! Thanks.
"Brock Allen" wrote:

> Control.ResolveClientUrl (also Page.ResolveClientUrl) is the helper API in
> 2.0 for this.
> -Brock
> http://staff.develop.com/ballen
>
>
>

0 comments:

Post a Comment