diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx new file mode 100644 index 0000000..c153f06 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion.WebForm1" %> + + + + + + + + +
+
+ Choose a background color:
+

+Choose a font:
+

+Specify a numeric font size:
+

+Choose a border style:
+

+

+Enter the greeting text below:
+

+ + +
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.cs new file mode 100644 index 0000000..38165ab --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + + + } + } + protected void cmdUpdate_Click(object sender, EventArgs e) + { + HttpCookie Cookie = Request.Cookies["Attributes"]; + if (Cookie == null) + { + Cookie = new HttpCookie("Attributes"); + } + Cookie["back"] = lstBackColor.SelectedItem.Text; + Cookie["fontn"] = lstFontName.SelectedItem.Text; + Cookie["fonts"] = txtFontSize.Text; + Cookie["border"] = lstBorder.SelectedItem.Text; + Cookie["text"] = txtGreeting.Text; + + Cookie.Expires = DateTime.Now.AddYears(1); + Response.Cookies.Add(Cookie); + Response.Redirect("greetingcardpage.aspx"); + } + + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..8f17381 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm1.aspx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx new file mode 100644 index 0000000..65f292d --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx @@ -0,0 +1,24 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion.WebForm2" %> + + + + + + + + +
+
+ +
  +


+ +
+
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.cs new file mode 100644 index 0000000..9f55814 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion +{ + public partial class WebForm2 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + HttpCookie Cookie = Request.Cookies["Attributes"]; + if (Cookie == null) + { + Response.Redirect("GreetingCardMaker_version8.aspx"); + } + else + { + + pnlCard.BackColor = Color.FromName(Cookie["back"]); + + // Update the font. + lblGreeting.Font.Name = Cookie["fontn"]; + if (Int32.Parse(Cookie["fonts"]) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(Cookie["fonts"])); + } + + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( + Cookie["borderstyle"]); + + + // Set the text. + lblGreeting.Text = Cookie["greetingtext"]; + + + } + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.designer.cs new file mode 100644 index 0000000..5076201 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/CookieVersion/WebForm2.aspx.designer.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion { + + + public partial class WebForm2 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx new file mode 100644 index 0000000..ea1f6ae --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx @@ -0,0 +1,56 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Multiview.WebForm1" %> + + + + + + + + +
+
+ + + + Choose a foreground (text) color:
+ +

+ Choose a background color:
+ +
+ + + Choose a border style:
+ +
+ +
+ + + + Choose a font name:
+ +

+ Specify a font size:
+ +

+ Enter the greeting text below:
+ +
+
+ +
  +


+ +
+
+ + + + + + + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.cs new file mode 100644 index 0000000..7c6e2e6 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Multiview +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + MultiView1.ActiveViewIndex = 0; + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstForeColor.DataSource = colorArray; + lstForeColor.DataBind(); + + string[] colorArray1 = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray1; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + imgDefault.ImageUrl = "image/default.jpg"; + } + + } + + + + protected void ChangeFore(object sender, EventArgs e) + { + pnlCard2.ForeColor = Color.FromName(lstForeColor.SelectedItem.Text); + + } + + protected void ChangeBack(object sender, EventArgs e) + { + pnlCard2.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); + + } + + protected void ChangeBorder(object sender, EventArgs e) + { + TypeConverter converter = TypeDescriptor.GetConverter(typeof(BorderStyle)); + pnlCard2.BorderStyle = (BorderStyle)converter.ConvertFromString( + lstBorder.SelectedItem.Text); + + } + + protected void Picture(object sender, EventArgs e) + { + if (chkPicture.Checked) + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + + } + + protected void ChangeFont(object sender, EventArgs e) + { + lblGreeting.Font.Name = lstFontName.SelectedItem.Text; + + } + + protected void ChangeFontSize(object sender, EventArgs e) + { + + if (Int32.Parse(txtFontSize.Text) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(txtFontSize.Text)); + } + } + + protected void ChangeText(object sender, EventArgs e) + { + lblGreeting.Text = txtGreeting.Text; + + } + + protected void Button1_Click1(object sender, EventArgs e) + { + MultiView1.SetActiveView(View1); + } + + protected void Button2_Click2(object sender, EventArgs e) + { + MultiView1.SetActiveView(View2); + } + + protected void Button3_Click3(object sender, EventArgs e) + { + MultiView1.SetActiveView(View3); + } + + + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..5ae1705 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Multiview/WebForm1.aspx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Multiview { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// MultiView1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.MultiView MultiView1; + + /// + /// View1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.View View1; + + /// + /// lstForeColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstForeColor; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// View2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.View View2; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// View3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.View View3; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// pnlCard2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard2; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + + /// + /// Button1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button Button1; + + /// + /// Button2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button Button2; + + /// + /// Button3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button Button3; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx new file mode 100644 index 0000000..15d74ab --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx @@ -0,0 +1,34 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Query_String.WebForm1" %> + + + + + + + + +
+
+ + Choose Background Color +

+ + Choose a font:
+

+ + Specify a numeric font size:
+

+ + Choose a border style:
+

+ +

+ + Enter the greeting text below:
+

+ +
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.cs new file mode 100644 index 0000000..a745ec1 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Query_String +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + + } + } + + protected void cmdUpdate_Click(object sender, EventArgs e) + { + string s1, s2, s3, s4, s5; + bool s6; + s1 = lstBackColor.SelectedItem.Text; + s2 = lstFontName.SelectedItem.Text; + s3 = lstBorder.SelectedItem.Text; + s4 = txtFontSize.Text; + s5 = txtGreeting.Text; + s6 = chkPicture.Checked; + Response.Redirect("~/Greeting Card Programs/Query String/WebForm2.aspx?val1=" + s1 + "&val2=" + s2 + "&val3=" + s3 + "&val4=" + s4 + "&val5=" + s5 + "&val6=" + s6); + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..59079b0 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm1.aspx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Query_String { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx new file mode 100644 index 0000000..cad15b3 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx @@ -0,0 +1,25 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Query_String.WebForm2" %> + + + + + + + + +
+
+ + +
  +


+ +
+
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.cs new file mode 100644 index 0000000..b929f70 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Drawing; +using System.Drawing.Text; +using System.ComponentModel; + +namespace WebApplication1.Greeting_Card_Programs.Query_String +{ + public partial class WebForm2 : System.Web.UI.Page + { + string str1, str2, str3, str4, str5, str6; + protected void Page_Load(object sender, EventArgs e) + { + str1 = Request.QueryString["val1"].ToString(); + + str2 = Request.QueryString["val2"].ToString(); + + str3 = Request.QueryString["val3"].ToString(); + + str4 = Request.QueryString["val4"].ToString(); + + str5 = Request.QueryString["val5"].ToString(); + str6 = Request.QueryString["val6"].ToString(); + pnlCard.BackColor = Color.FromName(str1); + imgDefault.ImageUrl = "image/default.jpg"; + // Update the font. + lblGreeting.Font.Name = str2; + if (Int32.Parse(str4) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(str4)); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + // Find the appropriate TypeConverter for the BorderStyle enumeration. + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + // Update the border style using the value from the converter. + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( + str3); + // Update the picture. + if (str6 == "True") + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + // Set the text. + lblGreeting.Text = str5; + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.designer.cs new file mode 100644 index 0000000..81ea2c5 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/WebForm2.aspx.designer.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Query_String { + + + public partial class WebForm2 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/image/default.jpg b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/image/default.jpg new file mode 100644 index 0000000..5d880ac Binary files /dev/null and b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Query String/image/default.jpg differ diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx new file mode 100644 index 0000000..cb4e2d6 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx @@ -0,0 +1,33 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Session_Version.WebForm1" %> + + + + + + + + +
+
+ Choose a background color:
+

+Choose a font:
+

+Specify a numeric font size:
+

+Choose a border style:
+

+

+Enter the greeting text below:
+

+ +
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.cs new file mode 100644 index 0000000..e0a7d51 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Session_Version +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + + } + } + protected void cmdUpdate_Click(object sender, EventArgs e) + { + Session["backcolor"] = lstBackColor.SelectedItem.Text; + Session["fontname"] = lstFontName.SelectedItem.Text; + Session["fontsize"] = txtFontSize.Text; + Session["borderstyle"] = lstBorder.SelectedItem.Text; + Session["greetingtext"] = txtGreeting.Text; + Session["chkpic"] = chkPicture.Checked; + + Response.Redirect("WebForm2.aspx"); + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..4cd62e4 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm1.aspx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Session_Version { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx new file mode 100644 index 0000000..756422d --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx @@ -0,0 +1,25 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Session_Version.WebForm2" %> + + + + + + + + +
+
+ +
  +


+ +
+ +
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.cs new file mode 100644 index 0000000..7fa2e5e --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Session_Version +{ + public partial class WebForm2 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + imgDefault.ImageUrl = "image/default.jpg"; + pnlCard.BackColor = Color.FromName(Session["backcolor"].ToString()); + + // Update the font. + lblGreeting.Font.Name = Session["fontname"].ToString(); + if (Int32.Parse(Session["fontsize"].ToString()) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(Session["fontsize"].ToString())); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + // Find the appropriate TypeConverter for the BorderStyle enumeration. + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + // Update the border style using the value from the converter. + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( + Session["borderstyle"].ToString()); + // Update the picture. + if (Session["chkpic"].ToString() == "True") + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + + lblGreeting.Text = Session["greetingtext"].ToString(); + + + } + } +} + \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.designer.cs new file mode 100644 index 0000000..d6e3906 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/WebForm2.aspx.designer.cs @@ -0,0 +1,51 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Session_Version { + + + public partial class WebForm2 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/image/default.jpg b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/image/default.jpg new file mode 100644 index 0000000..5d880ac Binary files /dev/null and b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Session Version/image/default.jpg differ diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx new file mode 100644 index 0000000..fb4161f --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx @@ -0,0 +1,43 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Version1.WebForm1" %> + + + + + + + + +
+
+ Choose a background color:
+

+ + Choose a font:
+

+ + Specify a numeric font size:
+

+ + Choose a border style:
+

+

+ + Enter the greeting text below:
+

+ +
+ + + +
  +


+ +
+
+ + + + + + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.cs new file mode 100644 index 0000000..c24c05b --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.cs @@ -0,0 +1,87 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Version1 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!this.IsPostBack) + { + // Set color options. + lstBackColor.Items.Add("White"); + lstBackColor.Items.Add("Red"); + lstBackColor.Items.Add("Green"); + lstBackColor.Items.Add("Blue"); + lstBackColor.Items.Add("Yellow"); + // Set font options. + lstFontName.Items.Add("Times New Roman"); + lstFontName.Items.Add("Arial"); + lstFontName.Items.Add("Verdana"); + lstFontName.Items.Add("Tahoma"); + // Set border style options by adding a series of + // ListItem objects. + ListItem item = new ListItem(); + // The item text indicates the name of the option. + item.Text = BorderStyle.None.ToString(); + // The item value records the corresponding integer + // from the enumeration. To obtain this value, you + // must cast the enumeration value to an integer, + // and then convert the number to a string so it + // can be placed in the HTML page. + item.Value = ((int)BorderStyle.None).ToString(); + // Add the item. + lstBorder.Items.Add(item); + // Now repeat the process for two other border styles. + item = new ListItem(); + item.Text = BorderStyle.Double.ToString(); + item.Value = ((int)BorderStyle.Double).ToString(); + lstBorder.Items.Add(item); + item = new ListItem(); + item.Text = BorderStyle.Solid.ToString(); + item.Value = ((int)BorderStyle.Solid).ToString(); + lstBorder.Items.Add(item); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + imgDefault.ImageUrl = "defaultpic.png"; + } + } + protected void cmdUpdate_Click(object sender, EventArgs e) + { + // Update the color. + pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); + + // Update the font. + lblGreeting.Font.Name = lstFontName.SelectedItem.Text; + if (Int32.Parse(txtFontSize.Text) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(txtFontSize.Text)); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); + pnlCard.BorderStyle = (BorderStyle)borderValue; + // Update the picture. + if (chkPicture.Checked) + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + // Set the text. + lblGreeting.Text = txtGreeting.Text; + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..ec83f0e --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version1/WebForm1.aspx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Version1 { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx new file mode 100644 index 0000000..e35a204 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx @@ -0,0 +1,45 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Version2.WebForm1" %> + + + + + + + + +
+
+ + Choose a background color:
+

+ + Choose a font:
+

+ + Specify a numeric font size:
+

+ + Choose a border style:
+

+ +

+ + Enter the greeting text below:
+

+ +
+ + +
  +


+ +
+ +
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.cs new file mode 100644 index 0000000..55130d8 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Version2 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + imgDefault.ImageUrl = "image/default.jpg"; + } + } + protected void cmdUpdate_Click(object sender, EventArgs e) + { + // Update the color. + pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); + + // Update the font. + lblGreeting.Font.Name = lstFontName.SelectedItem.Text; + if (Int32.Parse(txtFontSize.Text) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(txtFontSize.Text)); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + // Find the appropriate TypeConverter for the BorderStyle enumeration. + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + // Update the border style using the value from the converter. + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( + lstBorder.SelectedItem.Text); + // Update the picture. + if (chkPicture.Checked) + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + // Set the text. + lblGreeting.Text = txtGreeting.Text; + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..6fb79c2 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Version2/WebForm1.aspx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Version2 { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx new file mode 100644 index 0000000..3f6e823 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx @@ -0,0 +1,47 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.ViewState.WebForm1" %> + + + + + + + + +
+
+ +Choose a background color:
+

+Choose a font:
+

+Specify a numeric font size:
+

+Choose a border style:
+

+

+Enter the greeting text below:
+

+  + +
+ + +
  +


+ +
+ +
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.cs new file mode 100644 index 0000000..21b052a --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.ViewState +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + + // Set color options. + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + imgDefault.ImageUrl = "image/default.jpg"; + } + else + { + backcolor = (string)ViewState["backcolor"]; + fontname = (string)ViewState["fontname"]; + fontsize = (Int32)ViewState["fontsize"]; + borderstyle = (string)ViewState["borderstyle"]; + greetingtext = (string)ViewState["greetingtext"]; + } + } + + private string backcolor, fontname, borderstyle, greetingtext; + private Int32 fontsize; + protected void cmdSave_Click(object sender, EventArgs e) + { + backcolor = lstBackColor.SelectedItem.Text; + fontname = lstFontName.SelectedItem.Text; + fontsize = Int32.Parse(txtFontSize.Text); + borderstyle = lstBorder.SelectedItem.Text; + greetingtext = txtGreeting.Text; + + } + protected void Page_PreRender(object sender, EventArgs e) + { + ViewState["backcolor"] = backcolor; + ViewState["fontname"] = fontname; + ViewState["fontsize"] = fontsize; + ViewState["borderstyle"] = borderstyle; + ViewState["greetingtext"] = greetingtext; + + } + + protected void cmdUpdate_Click(object sender, EventArgs e) + { + pnlCard.BackColor = Color.FromName(backcolor); + + // Update the font. + lblGreeting.Font.Name = fontname; + if (Int32.Parse(txtFontSize.Text) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(fontsize); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + // Find the appropriate TypeConverter for the BorderStyle enumeration. + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + // Update the border style using the value from the converter. + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString(borderstyle); + // Update the picture. + if (chkPicture.Checked) + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + // Set the text. + lblGreeting.Text = greetingtext; + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..1fa9504 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/ViewState/WebForm1.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.ViewState { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// cmdSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdSave; + + /// + /// cmdUpdate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button cmdUpdate; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +} diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx new file mode 100644 index 0000000..23cd34e --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx @@ -0,0 +1,54 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Wizard_Control.WebForm1" %> + + + + + + + + +
+
+ + + + Choose a foreground (text) color:
+ +
+ Choose a background color:
+ +
+ + + Choose a border style:
+ +

+ +
+ + + Choose a font name:
+ +

+ Specify a font size:
+ +

+ Enter the greeting text below:
+ +
+ + + +
  +


+ +
+
+
+
+
+
+ + diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.cs new file mode 100644 index 0000000..929ee3e --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Drawing.Text; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1.Greeting_Card_Programs.Wizard_Control +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + InstalledFontCollection fonts = new InstalledFontCollection(); + if (!this.IsPostBack) + { + string[] colorArray = Enum.GetNames(typeof(KnownColor)); + lstForeColor.DataSource = colorArray; + lstForeColor.DataBind(); + // Set color options. + string[] colorArray1 = Enum.GetNames(typeof(KnownColor)); + lstBackColor.DataSource = colorArray1; + lstBackColor.DataBind(); + // Set font options. + foreach (FontFamily family in fonts.Families) + { + lstFontName.Items.Add(family.Name); + } + + // Set border style options + string[] borderStyleArray = Enum.GetNames(typeof(BorderStyle)); + lstBorder.DataSource = borderStyleArray; + lstBorder.DataBind(); + // Select the first border option. + lstBorder.SelectedIndex = 0; + // Set the picture. + imgDefault.ImageUrl = "image/default.jpg"; + } + } + protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e) + { + pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); + + pnlCard.ForeColor = Color.FromName(lstForeColor.SelectedItem.Text); + // Update the font. + lblGreeting.Font.Name = lstFontName.SelectedItem.Text; + if (Int32.Parse(txtFontSize.Text) > 0) + { + lblGreeting.Font.Size = + FontUnit.Point(Int32.Parse(txtFontSize.Text)); + } + // Update the border style. This requires two conversion steps. + // First, the value of the list item is converted from a string + // into an integer. Next, the integer is converted to a value in + // the BorderStyle enumeration. + // Find the appropriate TypeConverter for the BorderStyle enumeration. + TypeConverter converter = + TypeDescriptor.GetConverter(typeof(BorderStyle)); + // Update the border style using the value from the converter. + pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( + lstBorder.SelectedItem.Text); + // Update the picture. + if (chkPicture.Checked) + { + imgDefault.Visible = true; + } + else + { + imgDefault.Visible = false; + } + // Set the text. + lblGreeting.Text = txtGreeting.Text; + } + } +} \ No newline at end of file diff --git a/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.designer.cs b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.designer.cs new file mode 100644 index 0000000..1e9f1d3 --- /dev/null +++ b/WebApplication1/WebApplication1/CE128_Dharmang_Solanki/Greeting Card Programs/Wizard Control/WebForm1.aspx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebApplication1.Greeting_Card_Programs.Wizard_Control { + + + public partial class WebForm1 { + + /// + /// form1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// Wizard1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Wizard Wizard1; + + /// + /// lstForeColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstForeColor; + + /// + /// lstBackColor control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstBackColor; + + /// + /// lstBorder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButtonList lstBorder; + + /// + /// chkPicture control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPicture; + + /// + /// lstFontName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList lstFontName; + + /// + /// txtFontSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFontSize; + + /// + /// txtGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtGreeting; + + /// + /// pnlCard control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel pnlCard; + + /// + /// lblGreeting control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblGreeting; + + /// + /// imgDefault control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgDefault; + } +}