1

I need to use ResolveUrl in my javascript function.

How can I use it?

Note

In my javascript function I'm setting some images to show a message box. Since my pages are in different places(root, other folders) I need to use ResolveUrl.

Thanks

bahar_Agi
  • 644
  • 4
  • 17
  • 29
  • possible duplicate of http://stackoverflow.com/questions/1880550/can-i-use-resolveurl-in-javascript – Prabhuram Jun 26 '13 at 06:55
  • I've seen this post.. I have a variable like: **var msgBoxImagePath = '<%= ResolveUrl("Images/MessageBox/") %>';** but seems the path is unknown and the images are not shown. – bahar_Agi Jun 26 '13 at 06:57

1 Answers1

-1

Why don't you try adding '~/' before relative path?

var msgBoxImagePath = '<%= ResolveUrl("Images/MessageBox/") %>';

change to

var msgBoxImagePath = '<%=Page.ResolveUrl("~/Images/MessageBox/") %>';

Leo0554
  • 21
  • 2