protected void Page_Load(object sender, EventArgs e) { string imgUrl = "http://res2.windows.microsoft.com/resbox/en/windows%207/main/0d8a4985-b5e2-41a6-a1b6-e4bafb517937_92.png"; SPPageStatusSetter statusSetter = new SPPageStatusSetter(); statusSetter.AddStatus("Title", string.Format("可以使用html的内容: <img src={0}>", imgUrl), SPPageStatusColor.Yellow); this.Controls.Add(statusSetter); }
public static void SetStatus(HtmlForm form, string title, string message, SPPageStatusColor color) { var statusSetter = new SPPageStatusSetter { Visible = true }; statusSetter.AddStatus(title + ":", message, color); form.Controls.Add(statusSetter); }
/// <summary> /// This method displays custom feature disabled message and also disbles set of features activation and deactivation /// </summary> /// <param name="writer"></param> protected override void Render(HtmlTextWriter writer) { if (IsRendered) { SPPageStatusSetter ctlStatusBar = new SPPageStatusSetter(); ctlStatusBar.AddStatus( Settings.customDisableMsgTitle, Settings.customDisableMgsHtml, SPPageStatusColor.Yellow); this.Controls.Add(ctlStatusBar); } base.Render(writer); }