This repository was archived by the owner on Oct 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathNotifyPanel.cs
More file actions
48 lines (40 loc) · 1.26 KB
/
Copy pathNotifyPanel.cs
File metadata and controls
48 lines (40 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace BootstrapControls
{
[DefaultProperty("Text")]
[ToolboxData("<{0}:NotifyPanel runat=server></{0}:NotifyPanel>")]
public class NotifyPanel : WebControl
{
public bool Dismissable
{
get; set;
}
public NotifyTypeOption State
{
get; set;
}
public string Message
{
get;
set;
}
protected override void RenderContents(HtmlTextWriter w)
{
if (Message != null)
{
w.Write(String.Format(@"<div class=""alert {0} {1}"" role=""alert"">", (this.Dismissable) ? "alert-dismissible" : string.Empty, (this.State.ToString().Length > 0) ? "alert-" + this.State.ToString().ToLower() : string.Empty));
if (this.Dismissable)
w.Write(String.Format(@"<button type=""button"" class=""close"" data-dismiss=""alert"" aria-label=""Close""><span aria-hidden=""true"">×</span></button>"));
w.Write(Message);
w.Write("</div>");
}
}
}
}