Link to home
Start Free TrialLog in
Avatar of CipherIS
CipherISFlag for United States of America

asked on

ASP.NET C# - How do you add a Custom Attribute to a TextBox

How do I add a custom attribute to a textbox or any control?
ASKER CERTIFIED SOLUTION
Avatar of omgang
omgang
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CipherIS

ASKER

Thanks.  If i'm looping through a control, how do I get the value of the custom attribute?
Thanks for accepting my answer.  As for your question about looping through the attributes
see http://msdn.microsoft.com/en-us/library/kkeesb2c(v=vs.100).aspx

            string myText = "";
            foreach(string key in TextBox1.Attributes.Keys)
            {
                myText += key + " = " + TextBox1.Attributes[key];
            }

OM Gang