HighTechTalks DotNet Forums  

Re: ExpandableObject...what is wrong

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Re: ExpandableObject...what is wrong in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Brian Bugge
 
Posts: n/a

Default Re: ExpandableObject...what is wrong - 07-04-2003 , 10:13 PM






Yes thx...

"awhk" <awhk (AT) portalcontext (DOT) nospam> wrote

Quote:
Hi Brian,

You must instantiate the BackgroundImage class in the constructor of the
class where you expose the property.

public class MyControl : System.Web.UI.WebControls.WebControl
{
private BackgroundImage bgImage;
public ExpandBox()
{
BgImage = new BackgroundImage(); //Do this!
}
public BackgroundImage BgImage
{
get{return bgImage;}
set{bgImage = value;}
}
}


[TypeConverter(typeof(ExpandableObjectConverter))]
public class BackgroundImage
{
private string image;
public string Image
{
get{return image;}
set{image=value;}
}
}



awhk


"Brian Bugge" <bugge (AT) elvis (DOT) dk> wrote in message
news:uoHAT6JPDHA.3768 (AT) tk2msftngp13 (DOT) phx.gbl...
I'm writing a simple webcontrol, which has a property "BackgroundImage".
This property has to be expandable, but it doesn't work

Below is the class for the property. Can someone tell me what i might do
wrong.

[TypeConverterAttribute(typeof(ExpandableObjectConv erter))]

public class BackgroundImage{

private string image;

public string Image{

get{return image;}

set{image=value;}

}

}



Brian Bugge - Denmark







Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.