Resolve URL's for ASP.NET in jQuery?

Posted by TruMan1 on Stack Overflow See other posts from Stack Overflow or by TruMan1
Published on 2010-05-30T06:30:58Z Indexed on 2010/05/30 6:42 UTC
Read the original article Hit count: 241

Filed under:
|
|

I would like to use "~/" and resolve on the client site.

For example, I would want to do this:

<a href="~/page.aspx">website link</a>
<img src="~/page.aspx" />

I would have my base URL's in ASP.NET like this:

<script type="text/javascript">
        var baseUrl = "<%= ResolveUrl("~/") %>";
</script>

Would I need a jQuery plugin for this or can this be a achieved with a chained command?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about JavaScript