Question

I am using resolveUrl to call a virtual directory specified in my web config. Recently my error log gave me a issue to where it prepened a long string to this path. So to be clear it resolved the proper url but added a string that was over 240 chars long. I am wondering if anyone has ever had an issue with this.

Here is the call:

string originalImage = ResolveUrl(m_photoVirtualPath) + "/" + table.Rows[0]["Key"].ToString() + "/" + table.Rows[0]["LargeImageFileName"].ToString();

Here is the output error:

(F(7teHGa3jtAWTm0cKjtcKe8aKQMb99ykEWnc2c8L7RGHP28aRwzXYDhA8vWHRepIqFN67FGtHRN41v3kiseUsbMoNZqUDgS9h7g8acMSFRDPTYxbM3UA2pUXAUzWJcCWU4A3oVlFz6YoAqXVCAGNJiGbUiWdjcsREGNAkdQHkzX6SjCf12QonsibppUVPiean-saajTAzQjgoRK1qnFactg2))/storage-pub/Photo/2901502/40719_19760_2903337.jpg

the /storage-pub/Photo is the correct resolved url shown in bold above and the directories after are also correct but I have no idea what the string is before the resolved url.

Was it helpful?

Solution 2

It turns out after some debugging that it was the cookie string that was getting pre-appended to the URL. Still not sure as to why or how it happened but by using the tracing features in vs2010 I was able to view all my cookie and session strings and from there I was able to compare them to the string in the URL. Thank you all for your help and guidance.

OTHER TIPS

You can try with Server.MapPath

string originalImage = Path.Combine(Server.MapPath(m_photoVirtualPath) , table.Rows[0]["Key"].ToString() , table.Rows[0]["LargeImageFileName"].ToString());
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top