S
Sanjay Pais
Hi,
I have successfully added my TextBox control that inherits from the
TextBox. I have added a property called ApplySecurity that can be changed in
the designer and is reflected in the source HTML.
I want to add the TextBox icon in the toolbox and want the value to toggle
in the property window in design mode. The values allowed are True & False.
How can I achieve this?
We are using VS 2005 Beta 2
Cheers
Sanjay
Source Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;
using System.Diagnostics;
using System.Design;
[ToolboxData("<{0}:ATextBox runat=server
ApplySecurity=False></{0}:ATextBox>")]
public class ATextBox : System.Web.UI.WebControls.TextBox
{
[Bindable(true),
Description("A custom AE Textbox"),
Category("Misc"),
DefaultValue("False")]
private string strApplySecurity = "False";
public string ApplySecurity
{
get
{
return strApplySecurity;
}
set
{
strApplySecurity = value;
}
}
protected override void Render(HtmlTextWriter w)
{
w.AddAttribute("ApplySecurity", strApplySecurity);
base.Render(w); }
}
I have successfully added my TextBox control that inherits from the
TextBox. I have added a property called ApplySecurity that can be changed in
the designer and is reflected in the source HTML.
I want to add the TextBox icon in the toolbox and want the value to toggle
in the property window in design mode. The values allowed are True & False.
How can I achieve this?
We are using VS 2005 Beta 2
Cheers
Sanjay
Source Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;
using System.Drawing;
using System.Diagnostics;
using System.Design;
[ToolboxData("<{0}:ATextBox runat=server
ApplySecurity=False></{0}:ATextBox>")]
public class ATextBox : System.Web.UI.WebControls.TextBox
{
[Bindable(true),
Description("A custom AE Textbox"),
Category("Misc"),
DefaultValue("False")]
private string strApplySecurity = "False";
public string ApplySecurity
{
get
{
return strApplySecurity;
}
set
{
strApplySecurity = value;
}
}
protected override void Render(HtmlTextWriter w)
{
w.AddAttribute("ApplySecurity", strApplySecurity);
base.Render(w); }
}