Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > adding a design time designerto a specific property

Reply
Thread Tools

adding a design time designerto a specific property

 
 
Angel
Guest
Posts: n/a
 
      09-28-2004
I added an image property to my custom control. the property type i set at as
string because I want the url that is to be used for the control. How do I
set for this image property when the developer is in the properties window
and clicks to enter this value for the property, the ability to view the Add
URL generic window to seach for the url. Here is a sample of my code:

<Category("Display"), DefaultValue("")> Public Property Image() As String
Get
If viewstate("Image") Is Nothing Then
Return _strImage
Else
Return CType(viewstate("Image"), String)
End If
End Get
Set(ByVal Value As String)
_strImage = Value
viewstate("Image") = _strImage
End Set
End Property

The developer will see this property in the properties window of the
control. I want the developer to be able to search for the url within the
properties window. this same "Add URL" prompt window is present on the src
property of an HTML Image control.

thank you...
 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      09-28-2004
"Angel" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I added an image property to my custom control. the property type i set at
>as
> string because I want the url that is to be used for the control. How do I
> set for this image property when the developer is in the properties window
> and clicks to enter this value for the property, the ability to view the
> Add
> URL generic window to seach for the url. Here is a sample of my code:
>
> <Category("Display"), DefaultValue("")> Public Property Image() As
> String
> Get
> If viewstate("Image") Is Nothing Then
> Return _strImage
> Else
> Return CType(viewstate("Image"), String)
> End If
> End Get
> Set(ByVal Value As String)
> _strImage = Value
> viewstate("Image") = _strImage
> End Set
> End Property
>
> The developer will see this property in the properties window of the
> control. I want the developer to be able to search for the url within the
> properties window. this same "Add URL" prompt window is present on the src
> property of an HTML Image control.


Add the EditorAttribute:

<Editor(typeof(System.Web.UI.Design.UrlEditor),typ eof(System.Drawing.Design.UITypeEditor))>
-----
John Saunders



 
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
Is time.time() < time.time() always true? flamesrock Python 8 11-24-2006 06:51 AM
Adding items in collection property during design mode Saimeera ASP .Net 0 05-10-2006 11:34 AM
Custom Server Control Can't read design time property Shimon Sim ASP .Net 7 08-03-2005 01:08 AM
using the Items property in the design time property window Ryan Taylor ASP .Net Building Controls 4 02-18-2005 01:50 PM
make property of user control available at design time Mark ASP .Net 0 04-29-2004 05:09 PM



Advertisments