Yes, take a look at the IAttributeAccessor interface. the ASP.NET UserControl object explicitly implements this interface. This allows any attributes added directly to the control in the markup to be transferred to the server side attribute collection.
Note that the default implementation on UserControl is not overridable but writes and reads from its internal attributes collection. To render these attributes to HTML in your user control, do something like this in the markup:
<div runat="server" ID="pnlOutermostDiv">
// control markup goes here
</div>
then in the code-behind of the user control do something like this:
protected override void OnPreRender(EventArgs e)
{
foreach (string key in Attributes.Keys)
{
pnlOutermostDiv.Attributes.Add(key, Attributes[key]);
}
base.OnPreRender(e);
}
Now when you do use the control like this:
<my:TextBox runat="server" extraproperty="extravalue" />
It will render like this:
<div id="ctl00_blablabla_blablabla" extraproperty="extravalue">
// rendered control HTML here
</div>