diff --git a/oop/2017-12-02_states/2017-12-02_states.sln b/oop/2017-12-02_states/2017-12-02_states.sln index 5b2a3a4..0f5923d 100644 --- a/oop/2017-12-02_states/2017-12-02_states.sln +++ b/oop/2017-12-02_states/2017-12-02_states.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26430.12 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2017-12-02_states", "2017-12-02_states\2017-12-02_states.csproj", "{3A1729B4-F3DA-4FF4-84C2-502F2DA2788C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "2017j-12-02_states", "2017-12-02_states\2017j-12-02_states.csproj", "{3A1729B4-F3DA-4FF4-84C2-502F2DA2788C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/oop/2017-12-02_states/2017-12-02_states/2017-12-02_states.csproj b/oop/2017-12-02_states/2017-12-02_states/2017j-12-02_states.csproj similarity index 94% rename from oop/2017-12-02_states/2017-12-02_states/2017-12-02_states.csproj rename to oop/2017-12-02_states/2017-12-02_states/2017j-12-02_states.csproj index 4628b34..21faa08 100644 --- a/oop/2017-12-02_states/2017-12-02_states/2017-12-02_states.csproj +++ b/oop/2017-12-02_states/2017-12-02_states/2017j-12-02_states.csproj @@ -17,8 +17,8 @@ v4.5.2 true - - + disabled + enabled @@ -70,6 +70,7 @@ + Web.config @@ -130,6 +131,13 @@ SecondPage.aspx + + UserName.ascx + ASPXCodeBehind + + + UserName.ascx + diff --git a/oop/2017-12-02_states/2017-12-02_states/Calculation.aspx b/oop/2017-12-02_states/2017-12-02_states/Calculation.aspx index c1916b3..0508461 100644 --- a/oop/2017-12-02_states/2017-12-02_states/Calculation.aspx +++ b/oop/2017-12-02_states/2017-12-02_states/Calculation.aspx @@ -15,10 +15,10 @@

- +

- +

diff --git a/oop/2017-12-02_states/2017-12-02_states/Default.aspx.cs b/oop/2017-12-02_states/2017-12-02_states/Default.aspx.cs index 4cd227d..5a09679 100644 --- a/oop/2017-12-02_states/2017-12-02_states/Default.aspx.cs +++ b/oop/2017-12-02_states/2017-12-02_states/Default.aspx.cs @@ -12,7 +12,6 @@ namespace _2017_12_02_states protected void Page_Load(object sender, EventArgs e) { - } protected void ButtonDefault_Click(object sender, EventArgs e) { diff --git a/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx b/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx index 2871236..cf2708a 100644 --- a/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx +++ b/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx @@ -1,5 +1,9 @@ <%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true" CodeBehind="MasterPageExample.aspx.cs" Inherits="_2017_12_02_states.MasterPageExample" %> + +<%@ Register Src="~/UserName.ascx" TagPrefix="uc1" TagName="UserName" %> + + diff --git a/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx.designer.cs b/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx.designer.cs index 01c4dc4..238c63f 100644 --- a/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx.designer.cs +++ b/oop/2017-12-02_states/2017-12-02_states/MasterPageExample.aspx.designer.cs @@ -3,15 +3,22 @@ // This code was generated by a tool. // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ -namespace _2017_12_02_states -{ - - - public partial class MasterPageExample - { +namespace _2017_12_02_states { + + + public partial class MasterPageExample { + + /// + /// UserName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::_2017_12_02_states.WebUserControl1 UserName; } } diff --git a/oop/2017-12-02_states/2017-12-02_states/UserName.ascx b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx new file mode 100644 index 0000000..f43195f --- /dev/null +++ b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx @@ -0,0 +1,3 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserName.ascx.cs" Inherits="_2017_12_02_states.WebUserControl1" %> + + \ No newline at end of file diff --git a/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.cs b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.cs new file mode 100644 index 0000000..525178e --- /dev/null +++ b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace _2017_12_02_states +{ + public partial class WebUserControl1 : System.Web.UI.UserControl + { + protected void Page_Load(object sender, EventArgs e) + { + if (Session["Username"] == null) + { + Session["Username"] = HttpContext.Current.User.Identity.Name; + } + LabelUsername.Text = Session["Username"].ToString(); + } + } +} \ No newline at end of file diff --git a/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.designer.cs b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.designer.cs new file mode 100644 index 0000000..2ca739c --- /dev/null +++ b/oop/2017-12-02_states/2017-12-02_states/UserName.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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 _2017_12_02_states { + + + public partial class WebUserControl1 { + + /// + /// LabelUsername control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label LabelUsername; + } +}