Re: Pb with skinID in templated columns having DataBinder.Eval

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Walter, it looks like a MS bug.

In fact when we set a SkinID in an hyperlink used in a Datalist, it appeard
that the path for the imageurl, comming from the skin, is set with a path
like ~/App_Themes/MyTheme/MyImage.gif.

We get this using the ItemDataBound event and tracing the imageurl for the
Hyperlink.

Until now this is not a problem, but it appears that during Render, the
private methods
System.Web.UI.Control.ResolveClientUrl(String relativeUrl)
expecting a relative url, transforms this in
.../../App_Themes/MyTheme/MyImage.gif
- this could be normal as the usercontrol being rendered is in an url 2
levels under the web site path-

then System.Web.Util.UrlPath.ReduceVirtualPath(String path) discovers that
we are trying to get beyond the site root url and throw an exception and the
code for hyperlink is not rendered.

So we transformed the imageurl set from the skin, removed the ~ and Render
runs normally.

Should we have to do this everytime, what could be the reason for this ?

ReduceVirtualPath seeems to be failing in some special conditions ???

Thanks for help.

CS







"Walter Wang [MSFT]" <wawang@xxxxxxxxxxxxxxxxxxxx> a écrit dans le message
de news: ekbiWXusHHA.1528@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi CS,

I think we can use some mock data to test the skin behavior.

Sorry I cannot tell exactly what might be wrong at current moment without
full code listing.



Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no
rights.



.



Relevant Pages