Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Web user control creation - Resolve an ImageUrl property if control themed

Reply
Thread Tools

Web user control creation - Resolve an ImageUrl property if control themed

 
 
injy
Guest
Posts: n/a
 
      04-06-2006
Hi

I'm creating a WebControl which has a themeable ImageUrl property :

<Bindable(True), Category("Appearance"),
Editor(GetType(System.Web.UI.Design.ImageUrlEditor ), GetType
System.Drawing.Design.UITypeEditor)), Description("Image Url"),
DefaultValue(""), Themeable(True), UrlProperty()> _
Public Property ImageUrl() As String
Get
Dim O As Object = Me.ViewState("ImageUrl")
If O Is Nothing Then Return String.Empty Else Return CStr(O)
End Get
Set(ByVal value As String)
Me.ViewState("ImageUrl") = value
End Set
End Property


- First question :

In the RenderContents sub, i render the image with an
AddAttribute(HtmlTextWriterAttribute.Src,
MyBase.ResolveClientUrl(Me.ImageUrl)) but this line don't work if the
control on page is skined by a line like this one : <myc:myControl
runat="server" ImageUrl="images/pic.gif" SkinID="myskinid" /> in the theme
..skin file.

In that case, the resolve url in the RenderContents sub return
"images/pic.gif" instead of ~/App_Themes/MyTheme/images/pic.gif, so how to
get the full relative path of the picture ?

- Second question :

For the control i have a control designer which render the control html in a
overrided GetDesignTimeHtml function.

If the control SkinID property is set, when i try CType(Me.Component,
MyControl).ImageUrl in GetDesignTimeHtml function, i get an empty string !?
So, how to get the full relative path of the picture in the designer ?

Thank you in advance for answer.

Olivier I.
France





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using themed css files requires a header control on the page samuelberthelot@googlemail.com ASP .Net 6 05-05-2010 12:20 PM
Using the ImageUrl property of the HyperLink control Nathan Sokalski ASP .Net 4 04-17-2009 11:47 PM
Using the ImageUrl property of the HyperLink control Nathan Sokalski ASP .Net Web Controls 4 04-17-2009 11:47 PM
src-resolve: Cannot resolve the name ... ivanet@gmail.com XML 1 03-23-2007 12:10 PM
mobile command control with ImageURL property set kapilp ASP .Net Mobile 8 04-05-2006 10:36 AM



Advertisments