N
Nathan Sokalski
I have my UserControls in a subdirectory called usercontrols. In the code
for one of my UserControls I have the following:
Public Property adimage() As String
Get
Return lnkAdvertisement.ImageUrl
End Get
Set(ByVal value As String)
Response.Write(Me.Page.ResolveClientUrl(value) & "<br/>" &
ControlChars.NewLine)
lnkAdvertisement.ImageUrl = Me.Page.ResolveClientUrl(value)
System.Diagnostics.Debug.Write(Me.Page.ResolveClientUrl(value))
End Set
End Property
In the Page that uses this UserControl I pass it the value
"images/bannerad.jpg". However, when I open the page, the Response.Write()
and Debug.Write() lines both output 'images/bannerad.jpg' but the value that
gets assigned to lnkAdvertisement.ImageUrl is
'usercontrols/images/bannerad.jpg'. Why is a different value being returned
by Me.Page.ResolveClientUrl(value)? My main goal is to make the paths I pass
when using the UserControl to be treated as relative to the path of the Page
containing the UserControl, not the path of the UserControl. What should I
do? Thanks.
for one of my UserControls I have the following:
Public Property adimage() As String
Get
Return lnkAdvertisement.ImageUrl
End Get
Set(ByVal value As String)
Response.Write(Me.Page.ResolveClientUrl(value) & "<br/>" &
ControlChars.NewLine)
lnkAdvertisement.ImageUrl = Me.Page.ResolveClientUrl(value)
System.Diagnostics.Debug.Write(Me.Page.ResolveClientUrl(value))
End Set
End Property
In the Page that uses this UserControl I pass it the value
"images/bannerad.jpg". However, when I open the page, the Response.Write()
and Debug.Write() lines both output 'images/bannerad.jpg' but the value that
gets assigned to lnkAdvertisement.ImageUrl is
'usercontrols/images/bannerad.jpg'. Why is a different value being returned
by Me.Page.ResolveClientUrl(value)? My main goal is to make the paths I pass
when using the UserControl to be treated as relative to the path of the Page
containing the UserControl, not the path of the UserControl. What should I
do? Thanks.