Tom Knowlton
asked on
Make new property show up in markup and in the control properties
public GlobalMethods.InfoGatherKi nd GatherKind
{
get
{
return GlobalMethods.igatherkind;
}
}
I want to be able to set the GatherKind in the markup and the control Properties. How do I do this please?
I know it is an attribute of some sort above the property name [Persist...] or something or other.
{
get
{
return GlobalMethods.igatherkind;
}
}
I want to be able to set the GatherKind in the markup and the control Properties. How do I do this please?
I know it is an attribute of some sort above the property name [Persist...] or something or other.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nevermind...
This seems to be working well...
This seems to be working well...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;
using System.ComponentModel;
//Taken from
//
//http://www.codeproject.com/KB/custom-controls/ASPNET_Password_TextBox.aspx
namespace Campus_Webstore
{
public class TextBoxWithCustomAttributes : TextBox
{
public TextBoxWithCustomAttributes()
{
}
[Category("Kinds")]
[BrowsableAttribute(true)]
public GlobalMethods.InfoGatherKind GatherKind
{
get
{
return GlobalMethods.igatherkind;
}
set
{
GlobalMethods.igatherkind = value;
}
}
public override string Text
{
get
{
return base.Text;
}
set
{
base.Text = value;
Attributes["value"] = value;
}
}
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
Attributes["value"] = Text;
}
}
}
ASKER
thx!
ASKER
Open in new window
It shows up in the Properties window now but is greyed-out
and...
it still does not show up in the markup attributes (in the HTML)