Ask a Question related to ASP.NET Building Controls, Design and Development.
-
injy #1
Web user control creation - Resolve an ImageUrl property if control themed
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 Guest
-
Set property in user control
I have a user control where I defined a boolean property. I tried to pass the property the following way: <aaa:MyControl runat="server" id="stan"... -
Modifying a property of a control contained in a user control
I have a user control that is made up of several HyperLink controls. In the Page_Load event of pages that use the control I want to change a... -
Collection Property problems with Image control ImageUrl property and URLBuilder
Been using reflector and examining what Microsoft does with the Rows property in the Table class. It looks like all of the items added to the rows... -
More Collection Property problems with Image control ImageUrl property and URLBuilder
After a few more hours of debugging I discovered that the URLBuilder solution that I mentioned previously does not work because there is no service... -
Can you set a default property for a user control?
I'm not even sure if what I'm doing is possible. I created a simple control that will be reused throughout the site. It will accept a large amount...



Reply With Quote

