protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
if(BalloonStyle == BalloonPopupStyle.Custom) {
if(CustomCssUrl == String.Empty)
throw new ArgumentException("Must pass CustomCssUrl value.");
if(CustomClassName == String.Empty)
throw new ArgumentException("Must pass CustomClassName value.");
var isLinked = false;
foreach(Control control in Page.Header.Controls) {
if(control.ID == "customCssUrl") {
isLinked = true;
break;
}
}
if(!isLinked) {
var css = new HtmlLink();
css.Href = ResolveUrl(CustomCssUrl);
css.Attributes["id"] = "customCssUrl";
css.Attributes["rel"] = "stylesheet";
css.Attributes["type"] = "text/css";
css.Attributes["media"] = "all";
Page.Header.Controls.Add(css);
}
}
}