-
Notifications
You must be signed in to change notification settings - Fork 16
/
v1_aditi_103.aspx.cs
83 lines (68 loc) · 2.54 KB
/
v1_aditi_103.aspx.cs
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace GreetingsWebApp.aditi_103_D2
{
public partial class v1_aditi_103 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
//set the Background color list
Bc_list.Items.Add("White");
Bc_list.Items.Add("Red");
Bc_list.Items.Add("Green");
Bc_list.Items.Add("Blue");
Bc_list.Items.Add("Yellow");
//set font options
Font_list.Items.Add("Times New Roman");
Font_list.Items.Add("Arial");
Font_list.Items.Add("Verdana");
Font_list.Items.Add("Tahoma");
//Add Border Styles
ListItem item = new ListItem();
item.Text = BorderStyle.None.ToString();
item.Value = ((int)BorderStyle.None).ToString();
Border_style.Items.Add(item);
item = new ListItem();
item.Text = BorderStyle.Double.ToString();
item.Value = ((int)BorderStyle.Double).ToString();
Border_style.Items.Add(item);
item = new ListItem();
item.Text = BorderStyle.Solid.ToString();
item.Value = ((int)BorderStyle.Solid).ToString();
Border_style.Items.Add(item);
Border_style.SelectedIndex = 0;
}
else
{
imgDefault.ImageUrl = "index.jpg";
}
}
protected void Update_Click(Object sender, EventArgs e)
{
pnlCard.BackColor = Color.FromName(Bc_list.SelectedItem.Text);
lblGreeting.Font.Name = Font_list.SelectedItem.Text;
if (Int32.Parse(Font_size.Text) > 0)
{
lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(Font_size.Text));
}
int borderValue = Int32.Parse(Border_style.SelectedItem.Value);
pnlCard.BorderStyle = (BorderStyle)borderValue;
if (Checkbox.Checked)
{
imgDefault.Visible = true;
}
else
{
imgDefault.Visible = false;
}
lblGreeting.Text = Greeting_text.Text;
}
}
}