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

Discussion in 'ASP .Net Building Controls' started by injy, Apr 7, 2006.

  1. injy

    injy Guest

    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
     
    injy, Apr 7, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    11,316
    elizas
    May 5, 2010
  2. Trapulo

    Localize themed label

    Trapulo, May 3, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    416
    Steven Cheng[MSFT]
    May 4, 2006
  3. =?Utf-8?B?UGF0cmljayBG?=

    Just a question regarding a themed webpage

    =?Utf-8?B?UGF0cmljayBG?=, Feb 24, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    356
    =?Utf-8?B?UGF0cmljayBG?=
    Feb 24, 2007
  4. Replies:
    1
    Views:
    10,346
  5. Python Nutter

    Themed TK (tk Tile) at last?!

    Python Nutter, Mar 7, 2009, in forum: Python
    Replies:
    1
    Views:
    328
    cgoldberg
    Mar 7, 2009
Loading...

Share This Page