UserControl.Attributes Property
.NET Framework 2.0
Gets a collection of all attribute name and value pairs declared in the user control tag within the .aspx file.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
/** @property */ public AttributeCollection get_Attributes ()
public function get Attributes () : AttributeCollection
Not applicable.
Property Value
An AttributeCollection object that contains all the name and value pairs declared in the user control tag.The following code example uses the user control's Attributes property to access the Message attribute declared in the custom control tag that instantiated the user control on the page that contains it.
void Page_Load(Object sender, System.EventArgs e)
{
get_Response().Write(
"<h2><b> User Control Properties Example</b></h2><br />");
// Retrieve and display the 'Message' attribute tag
// initialized in the .aspx code.
get_Response().Write(
"<b>Message tag value declared in the aspx file is : </b>"
+ myControl.get_Attributes().get_Item("Message"));
Community Additions
ADD
Show: