views:

546

answers:

3
 <script language="javascript" type="text/javascript">
                                                   banner2.add("FLASH", "../Banners/1.swf", 10, 60, 468,"http://www.techpint.com","_blank");
                        banner2.add("FLASH", "../Banners/2.swf", 10, 60, 468,"http://www.tapasya.co.in","_blank");

                    </script>

now here i want to get the base url of the site so that i can give path to my flash file in all pages. this script is a part of my master page. can i run " <%= ResolveUrl("~/Banners/1.swf") %> " in javascript.

banner2.add("FLASH"," <%= ResolveUrl("~/Banners/1.swf") %> ", 10, 60, 468,"http://www.techpint.com","_blank");
A: 

I think so, as long as your page is being processed by ASP.NET e.g. is not just a static HTML file.

Ian Oxley
i didn't got uThis script is in my asp.net page.now i want to resove a url for using it on multiple pages.But i want to know wheter it is possible to use resolveurl in javascipt code.will it recognize resolveUrl function
Shantanu Gupta
+1  A: 

Did you try this suggestion? : click me

infant programmer
need explanaton . Solution seems to be gud but not clear
Shantanu Gupta
+2  A: 

I got the solution. We dont have to do ny formating in javascript. I was using escape sequences to write the path. Thx nyway

banner2.add("FLASH", "<%= ResolveUrl("~/Banners/1.swf") %>", 10, 60, 468,"techpint.com","_blank";);
Shantanu Gupta