protected override void AddAttributesToRender(HtmlTextWriter writer)
{
if (Page != null)
Page.VerifyRenderingInServerForm (this);
#if NET_2_0
if (writer == null)
return;
if (!String.IsNullOrEmpty (UniqueID))
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
if (!IsEnabled && SelectedIndex == -1)
SelectedIndex = 1;
#else
writer.AddAttribute(HtmlTextWriterAttribute.Name, this.UniqueID, true);
#endif
if (AutoPostBack) {
#if NET_2_0
string onchange = Page.ClientScript.GetPostBackEventReference (GetPostBackOptions (), true);
onchange = String.Concat ("setTimeout('", onchange.Replace ("\\", "\\\\").Replace ("'", "\\'"), "', 0)");
writer.AddAttribute (HtmlTextWriterAttribute.Onchange, BuildScriptAttribute ("onchange", onchange));
#else
writer.AddAttribute (HtmlTextWriterAttribute.Onchange,
BuildScriptAttribute ("onchange", Page.ClientScript.GetPostBackClientHyperlink (this, "")));
#endif
}
base.AddAttributesToRender(writer);
}