Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Forked Folder #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Choose a background color:<br />
<asp:DropDownList ID="lstBackColor" runat="server" Width="194px"
Height="22px"/><br /><br />
Choose a font:<br />
<asp:DropDownList ID="lstFontName" runat="server" Width="194px"
Height="22px" /><br /><br />
Specify a numeric font size:<br />
<asp:TextBox ID="txtFontSize" runat="server" /><br /><br />
Choose a border style:<br />
<asp:RadioButtonList ID="lstBorder" runat="server" Width="177px"
Height="59px" /><br /><br />
<asp:CheckBox ID="chkPicture" runat="server"
Text="Add the Default Picture"></asp:CheckBox><br /><br />
Enter the greeting text below:<br />
<asp:TextBox ID="txtGreeting" runat="server" Width="240px" Height="85px"
Textmode="MultiLine" /><br /><br />
<asp:Button ID="cmdUpdate" OnClick="cmdUpdate_Click"
runat="server" Width="71px" Height="24px" Text="Update" />

</div>
</form>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -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");
}

}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="WebApplication1.CE128_Dharmang_Solanki.Greeting_Card_Programs.CookieVersion.WebForm2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Panel ID="pnlCard" runat="server"
Width="339px" Height="481px" HorizontalAlign="Center"
style="POSITION: absolute; TOP: 16px; LEFT: 313px;">
<br />&nbsp;
<asp:Label ID="lblGreeting" runat="server" Width="256px"
Height="150px" /><br /><br /><br />
<asp:Image ID="imgDefault" runat="server" Width="212px"
Height="160px" />
</asp:Panel>
</div>
</form>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -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"];


}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.Greeting_Card_Programs.Multiview.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:MultiView ID="MultiView1" runat="server" >

<asp:View ID="View1" runat="server">
Choose a foreground (text) color:<br />
<asp:DropDownList ID="lstForeColor" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ChangeFore" />
<br /><br />
Choose a background color:<br />
<asp:DropDownList ID="lstBackColor" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ChangeBack" />
</asp:View>

<asp:View ID="View2" runat="server">
Choose a border style:<br />
<asp:RadioButtonList ID="lstBorder" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ChangeBorder" RepeatColumns="2" />
<br />
<asp:CheckBox ID="chkPicture" runat="server" AutoPostBack="True" OnCheckedChanged="Picture" Text="Add the Default Picture" />
</asp:View>


<asp:View ID="View3" runat="server">
Choose a font name:<br />
<asp:DropDownList ID="lstFontName" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ChangeFont" />
<br /><br />
Specify a font size:<br />
<asp:TextBox ID="txtFontSize" runat="server" AutoPostBack="True" OnTextChanged="ChangeFontSize" />
<br /><br />
Enter the greeting text below:<br />
<asp:TextBox ID="txtGreeting" runat="server" AutoPostBack="True" OnTextChanged="ChangeText" TextMode="MultiLine" />
</asp:View>
</asp:MultiView>
<asp:Panel ID="pnlCard2" runat="server" Width="339px" Height="481px" HorizontalAlign="Center"
style="POSITION: absolute; TOP: 26px; LEFT: 496px;">
<br />&nbsp;
<asp:Label ID="lblGreeting" runat="server" Width="256px"
Height="150px" /><br /><br /><br />
<asp:Image ID="imgDefault" runat="server" Width="212px"
Height="160px" />
</asp:Panel>
</div>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click1" Text="View 1" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click2" Text="View 2" />
<asp:Button ID="Button3" runat="server" OnClick="Button3_Click3" Text="View 3" />

</form>
</body>
</html>
Loading