Question

The ResolveUrl here works fine and generates the desired path <a href='<%= Page.ResolveUrl("~/HomePage.aspx")%>'>Home</a>

But here

        $(document).ready(function() {

    upload1 = new SWFUpload({
        // Backend Settings
        upload_url: '<%= Page.ResolveUrl( "~/UserProfile/Photos.aspx") %>',

the path is not generated properly just /UserProfile/Photos.aspx is placed there.

both are on different pages.

Edit My desired output should to be www.domain.com/UserProfile/photos.aspx when I use this method on my development mahine it works fine and generates /applicationname/UserProfile/photos.aspx but not with the production environment. The application on the production environment is www.domain.com/wwwroot/Userprofile/photos.aspx. and the file SWFuploader is on the same Photos.aspx page.

Was it helpful?

Solution

It appears that you have a "Virtual Path" set up on your development server.

so - assuming that you're using Visual Studio's built in server. If you click on the root of your web site in the "Solution Explorer" panel on the right, then Right-click and choose "Properties Window" you will see the properties of your dev site. It looks as though you have a name in "Virtual Path".

you don't have this setting on your production enviroment.

If you prefer, set the virtual path in VS to "/" - it will then match your production environment.

If you want it so that your production environment has the virtual path then see this tutorial (assuming IIS 7)

Create a virtual directory (IIS 7)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top