E
Emil Georgiev
Hello
I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web
server control. I want to create a property "BrowserWindow" of my class "NewWinHyperLink" which will contain child
properties. When I use this custom control in testing web application these child properties don't appear with 'plus sign' in
visual studio designer. I want to make my parent property to have plus sign in order to expand in VS designer and adjust its
child properties (e.g. look at any web server contol and notice the Font property which have plus sign)
here is my sample code where I want to make BrowserWindow property appears with plus sign:
namespace CustomControl
{
[ToolboxData("<{0}:NewWinHyperLink runat=server></{0}:NewWinHyperLink>")]
public class NewWinHyperLink : System.Web.UI.WebControls.HyperLink
{
protected override void OnInit(EventArgs e)
{
base.Text = this.ID;
NavigateUrl = "#";
// Do whatever the control usually does OnInit
base.OnInit(e);
}
private BrowserWindowInfo bwi = new BrowserWindowInfo();
[Browsable(true),
Bindable(true),
Category("Design")]
public BrowserWindowInfo BrowserWindow //doesn't appear with plus sign!
{
get
{
return bwi;
}
set
{
bwi = value;
}
}
}
public class BrowserWindowInfo
{
// String settings: default is blank.
private string m_strURL = "about:blank";
// Integer settings: 0 invoked default.
private int m_Height = 0;
private int m_Width = 0;
[Browsable(true),
Bindable(true),
Category("Appearance")]
public string URL
{
get
{
return m_strURL;
}
set
{
m_strURL = value;
}
}
[Browsable(true),
Bindable(true),
Category("Appearance")]
public int Height
{
get
{
return m_Height;
}
set
{
m_Height = value;
}
}
[Browsable(true),
Bindable(true),
Category("Appearance")]
public int Width
{
get
{
return m_Width;
}
set
{
m_Width = value;
}
}
}
}
Can anyone please give me some hint? Do u think if I miss any attribute only?
Thanx.
I have a Web Custom Control project in ASP.NET. I'm using a subclassing technique to add functionality in HyperLink web
server control. I want to create a property "BrowserWindow" of my class "NewWinHyperLink" which will contain child
properties. When I use this custom control in testing web application these child properties don't appear with 'plus sign' in
visual studio designer. I want to make my parent property to have plus sign in order to expand in VS designer and adjust its
child properties (e.g. look at any web server contol and notice the Font property which have plus sign)
here is my sample code where I want to make BrowserWindow property appears with plus sign:
namespace CustomControl
{
[ToolboxData("<{0}:NewWinHyperLink runat=server></{0}:NewWinHyperLink>")]
public class NewWinHyperLink : System.Web.UI.WebControls.HyperLink
{
protected override void OnInit(EventArgs e)
{
base.Text = this.ID;
NavigateUrl = "#";
// Do whatever the control usually does OnInit
base.OnInit(e);
}
private BrowserWindowInfo bwi = new BrowserWindowInfo();
[Browsable(true),
Bindable(true),
Category("Design")]
public BrowserWindowInfo BrowserWindow //doesn't appear with plus sign!
{
get
{
return bwi;
}
set
{
bwi = value;
}
}
}
public class BrowserWindowInfo
{
// String settings: default is blank.
private string m_strURL = "about:blank";
// Integer settings: 0 invoked default.
private int m_Height = 0;
private int m_Width = 0;
[Browsable(true),
Bindable(true),
Category("Appearance")]
public string URL
{
get
{
return m_strURL;
}
set
{
m_strURL = value;
}
}
[Browsable(true),
Bindable(true),
Category("Appearance")]
public int Height
{
get
{
return m_Height;
}
set
{
m_Height = value;
}
}
[Browsable(true),
Bindable(true),
Category("Appearance")]
public int Width
{
get
{
return m_Width;
}
set
{
m_Width = value;
}
}
}
}
Can anyone please give me some hint? Do u think if I miss any attribute only?
Thanx.