diff --git a/1215.html b/1215.html new file mode 100644 index 0000000..b75e3e1 --- /dev/null +++ b/1215.html @@ -0,0 +1,14 @@ +Chapter 1 ASP.NET 2.0 at a Glance
+Chapter 2 Introducing VS .NET for Web Developers
+Chapter 3 Enhanced Data Controls
+Chapter 4 Working with Master Pages
+Chapter 5 Integrating Site Navigation
+Chapter 6 Managing Users
+Chapter 7 Personalization
+Chapter 8 Creating Portals with Web Parts
+Chapter 9 Applying Themes
+Chapter 10 Tracking Traffic with Site Counters
+Chapter 11 The Enhanced Page Framework and Cool New Controls
+Chapter 12 Going Mobile
+Chapter 13 Configuration for Developers and Administrators
+Chapter 14 Fun Pet Tricks \ No newline at end of file diff --git a/1264.pdf b/1264.pdf new file mode 100644 index 0000000..3137435 Binary files /dev/null and b/1264.pdf differ diff --git a/1265.pdf b/1265.pdf new file mode 100644 index 0000000..dff5375 Binary files /dev/null and b/1265.pdf differ diff --git a/9781590593370.jpg b/9781590593370.jpg new file mode 100644 index 0000000..cf606cb Binary files /dev/null and b/9781590593370.jpg differ diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f2c3c6e --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,27 @@ +Freeware License, some rights reserved + +Copyright (c) 2004 Patrick Lorenz + +Permission is hereby granted, free of charge, to anyone obtaining a copy +of this software and associated documentation files (the "Software"), +to work with the Software within the limits of freeware distribution and fair use. +This includes the rights to use, copy, and modify the Software for personal use. +Users are also allowed and encouraged to submit corrections and modifications +to the Software for the benefit of other users. + +It is not allowed to reuse, modify, or redistribute the Software for +commercial use in any way, or for a user’s educational materials such as books +or blog articles without prior permission from the copyright holder. + +The above copyright notice and this permission notice need to be included +in all copies or substantial portions of the software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS OR APRESS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + diff --git a/Listings/Chapter1/1-1/Generics1.cs b/Listings/Chapter1/1-1/Generics1.cs new file mode 100644 index 0000000..ae33739 --- /dev/null +++ b/Listings/Chapter1/1-1/Generics1.cs @@ -0,0 +1,14 @@ +using System; + +public class MyList { + + public void Add(ItemType obj) { + // ... + } + + public ItemType this[int index] { + get { + return ItemType.default; + } + } +} diff --git a/Listings/Chapter1/1-10/Iterators2.cs b/Listings/Chapter1/1-10/Iterators2.cs new file mode 100644 index 0000000..92ea2bc --- /dev/null +++ b/Listings/Chapter1/1-10/Iterators2.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; + +public class Names { + + private List names = new List(); + + public Names() { + this.names.Add("Smith"); + this.names.Add("Miller"); + this.names.Add("Doe"); + } + + public IEnumerator GetEnumerator() { + for(int i = 0; i < this.names.Count; i++) { + yield this.names[i]; + } + } +} + +// Main +public class MainClass { + + public static void Main() { + Names names = new Names(); + + foreach(string name in names) { + Console.WriteLine(name); + } + + Console.Read(); + } +} \ No newline at end of file diff --git a/Listings/Chapter1/1-11/Default.aspx b/Listings/Chapter1/1-11/Default.aspx new file mode 100644 index 0000000..1a653da --- /dev/null +++ b/Listings/Chapter1/1-11/Default.aspx @@ -0,0 +1,25 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ +
+
+ Please click da button! + + + + diff --git a/Listings/Chapter1/1-12/Default.aspx b/Listings/Chapter1/1-12/Default.aspx new file mode 100644 index 0000000..c957ad9 --- /dev/null +++ b/Listings/Chapter1/1-12/Default.aspx @@ -0,0 +1,26 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ +
+
+ Please click da button! + + + + diff --git a/Listings/Chapter1/1-13/Default.aspx b/Listings/Chapter1/1-13/Default.aspx new file mode 100644 index 0000000..e3b11c0 --- /dev/null +++ b/Listings/Chapter1/1-13/Default.aspx @@ -0,0 +1,27 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +
+
+ Please click da button! + + + + diff --git a/Listings/Chapter1/1-14/App.ico b/Listings/Chapter1/1-14/App.ico new file mode 100644 index 0000000..3a5525f Binary files /dev/null and b/Listings/Chapter1/1-14/App.ico differ diff --git a/Listings/Chapter1/1-14/AssemblyInfo.cs b/Listings/Chapter1/1-14/AssemblyInfo.cs new file mode 100644 index 0000000..f7a486e --- /dev/null +++ b/Listings/Chapter1/1-14/AssemblyInfo.cs @@ -0,0 +1,58 @@ +using System.Reflection; +using System.Runtime.CompilerServices; + +// +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +// +[assembly: AssemblyTitle("")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: + +[assembly: AssemblyVersion("1.0.*")] + +// +// In order to sign your assembly you must specify a key to use. Refer to the +// Microsoft .NET Framework documentation for more information on assembly signing. +// +// Use the attributes below to control which key is used for signing. +// +// Notes: +// (*) If no key is specified, the assembly is not signed. +// (*) KeyName refers to a key that has been installed in the Crypto Service +// Provider (CSP) on your machine. KeyFile refers to a file which contains +// a key. +// (*) If the KeyFile and the KeyName values are both specified, the +// following processing occurs: +// (1) If the KeyName can be found in the CSP, that key is used. +// (2) If the KeyName does not exist and the KeyFile does exist, the key +// in the KeyFile is installed into the CSP and used. +// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility. +// When specifying the KeyFile, the location of the KeyFile should be +// relative to the project output directory which is +// %Project Directory%\obj\. For example, if your KeyFile is +// located in the project directory, you would specify the AssemblyKeyFile +// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] +// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework +// documentation for more information on this. +// +[assembly: AssemblyDelaySign(false)] +[assembly: AssemblyKeyFile("")] +[assembly: AssemblyKeyName("")] diff --git a/Listings/Chapter1/1-14/ConsoleApp.csproj b/Listings/Chapter1/1-14/ConsoleApp.csproj new file mode 100644 index 0000000..e565209 --- /dev/null +++ b/Listings/Chapter1/1-14/ConsoleApp.csproj @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter1/1-14/ConsoleApp.csproj.user b/Listings/Chapter1/1-14/ConsoleApp.csproj.user new file mode 100644 index 0000000..f058bb5 --- /dev/null +++ b/Listings/Chapter1/1-14/ConsoleApp.csproj.user @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter1/1-14/Form1.resx b/Listings/Chapter1/1-14/Form1.resx new file mode 100644 index 0000000..17fc33f --- /dev/null +++ b/Listings/Chapter1/1-14/Form1.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.2.3400.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.2.3400.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + False + + + 80 + + + False + + + 8, 8 + + + False + + + (Default) + + + False + + + False + + \ No newline at end of file diff --git a/Listings/Chapter1/1-14/MainClass.cs b/Listings/Chapter1/1-14/MainClass.cs new file mode 100644 index 0000000..e04c9ea --- /dev/null +++ b/Listings/Chapter1/1-14/MainClass.cs @@ -0,0 +1,25 @@ +using System; +using System.Threading; + +namespace MyLittleConsoleApp { + + public class MainClass { + + [STAThread] + static void Main() { + Thread myThread = new Thread(delegate() { + for(int i = 0; i < 20; i++) { + Console.WriteLine("Working thread ..."); + Thread.Sleep(500); + } + }); + myThread.Start(); + + for (int i = 0; i < 10; i++) { + Console.WriteLine("In main."); + Thread.Sleep(1000); + } + Console.Read(); + } + } +} diff --git a/Listings/Chapter1/1-15/Foo1.cs b/Listings/Chapter1/1-15/Foo1.cs new file mode 100644 index 0000000..b8981f1 --- /dev/null +++ b/Listings/Chapter1/1-15/Foo1.cs @@ -0,0 +1,7 @@ +using System; + +public partial class Foo { + + public void SomeMethod() { + } +} diff --git a/Listings/Chapter1/1-15/Foo2.cs b/Listings/Chapter1/1-15/Foo2.cs new file mode 100644 index 0000000..cafe077 --- /dev/null +++ b/Listings/Chapter1/1-15/Foo2.cs @@ -0,0 +1,7 @@ +using System; + +public partial class Foo { + + public void SomeOtherMethod() { + } +} diff --git a/Listings/Chapter1/1-16/Foo.vb b/Listings/Chapter1/1-16/Foo.vb new file mode 100644 index 0000000..0512b6f --- /dev/null +++ b/Listings/Chapter1/1-16/Foo.vb @@ -0,0 +1,13 @@ +Imports Microsoft.VisualBasic + +'@ That's my little foo class +Public Class Foo + + '@ This methods return the text passed as parameter + '@ Text to be returned + '@ Returns the string passed as parameter + Public Function ReturnSomeString(ByVal Text As String) As String + Return Text + End Function + +End Class diff --git a/Listings/Chapter1/1-16/Foo.xml b/Listings/Chapter1/1-16/Foo.xml new file mode 100644 index 0000000..78d2c50 --- /dev/null +++ b/Listings/Chapter1/1-16/Foo.xml @@ -0,0 +1,17 @@ + + + + +Foo + + + + + This methods return the text passed as parameter + Text to be returned + Returns the string passed as parameter + + That's my little foo class + + + \ No newline at end of file diff --git a/Listings/Chapter1/1-17/Generics1.vb b/Listings/Chapter1/1-17/Generics1.vb new file mode 100644 index 0000000..f64ea23 --- /dev/null +++ b/Listings/Chapter1/1-17/Generics1.vb @@ -0,0 +1,34 @@ +Imports System + +Public Class MyList(Of ItemType As IComparable) + + Public Sub Add(ByVal Obj As ItemType) + End Sub + + Default Public ReadOnly Property Items(ByVal Index As Integer) As ItemType + Get + Return Nothing + End Get + End Property + +End Class + +Public Class Foo + Implements IComparable + + Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo + Return 0 + End Function +End Class + +Public Class MainClass + + Public Shared Sub Main() + Dim List As MyList(Of Foo) = New MyList(Of Foo) + List.Add(New Foo) + Dim AnotherFoo As Foo = List(0) + + Console.Read() + End Sub + +End Class \ No newline at end of file diff --git a/Listings/Chapter1/1-18/OperatorOverloads1.vb b/Listings/Chapter1/1-18/OperatorOverloads1.vb new file mode 100644 index 0000000..8a8230d --- /dev/null +++ b/Listings/Chapter1/1-18/OperatorOverloads1.vb @@ -0,0 +1,30 @@ +Imports System + +Public Structure Point + + Public X As Integer + Public Y As Integer + + Public Shared Operator +(ByVal p1 As Point, ByVal p2 As Point) As Point + Dim p As Point = New Point + p.X = p1.X + p2.X + p.Y = p1.Y + p2.Y + Return p + End Operator + + Public Shared Operator -(ByVal p1 As Point, ByVal p2 As Point) As Point + Dim p As Point = New Point + p.X = p1.X - p2.X + p.Y = p1.Y - p2.Y + Return p + End Operator + + Public Shared Operator =(ByVal p1 As Point, ByVal p2 As Point) As Boolean + Return ((p1.X = p2.X) AndAlso (p1.Y = p2.Y)) + End Operator + + Public Shared Operator <>(ByVal p1 As Point, ByVal p2 As Point) As Boolean + Return ((p1.X <> p2.X) OrElse (p1.Y <> p2.Y)) + End Operator + +End Structure diff --git a/Listings/Chapter1/1-19/OperatorOverloads2.vb b/Listings/Chapter1/1-19/OperatorOverloads2.vb new file mode 100644 index 0000000..dfea128 --- /dev/null +++ b/Listings/Chapter1/1-19/OperatorOverloads2.vb @@ -0,0 +1,31 @@ +Imports System + +Public Structure Point2D + + Public X As Integer + Public Y As Integer + +End Structure + +Public Structure Point3D + + Public X As Integer + Public Y As Integer + Public Z As Integer + + Public Shared Widening Operator CType(ByVal p1 As Point2D) As Point3D + Dim p2 As New Point3D + p2.X = p1.X + p2.Y = p1.Y + Return p2 + End Operator + + Public Shared Narrowing Operator CType(ByVal p1 As Point3D) As Point2D + Dim p2 As New Point2D + p2.X = p1.X + p2.Y = p1.Y + Return p2 + End Operator + +End Structure + diff --git a/Listings/Chapter1/1-2/Generics2.cs b/Listings/Chapter1/1-2/Generics2.cs new file mode 100644 index 0000000..f64ea23 --- /dev/null +++ b/Listings/Chapter1/1-2/Generics2.cs @@ -0,0 +1,34 @@ +Imports System + +Public Class MyList(Of ItemType As IComparable) + + Public Sub Add(ByVal Obj As ItemType) + End Sub + + Default Public ReadOnly Property Items(ByVal Index As Integer) As ItemType + Get + Return Nothing + End Get + End Property + +End Class + +Public Class Foo + Implements IComparable + + Public Function CompareTo(ByVal obj As Object) As Integer Implements System.IComparable.CompareTo + Return 0 + End Function +End Class + +Public Class MainClass + + Public Shared Sub Main() + Dim List As MyList(Of Foo) = New MyList(Of Foo) + List.Add(New Foo) + Dim AnotherFoo As Foo = List(0) + + Console.Read() + End Sub + +End Class \ No newline at end of file diff --git a/Listings/Chapter1/1-3/Generics3.cs b/Listings/Chapter1/1-3/Generics3.cs new file mode 100644 index 0000000..4d97608 --- /dev/null +++ b/Listings/Chapter1/1-3/Generics3.cs @@ -0,0 +1,33 @@ +using System; + +// MyList +public class MyList { + + public void Add(ItemType obj) { + // ... + } + + public ItemType this[int index] { + get { + return ItemType.default; + } + } +} + +// MyClass +public class MyClass { +} + +// Main +public class MainClass { + + public static void Main() { + + MyList myList = new MyList(); + MyClass myClass = new MyClass(); + myList.Add(myClass); + int myValue = myList[0]; // --> Compiler error + + Console.Read(); + } +} \ No newline at end of file diff --git a/Listings/Chapter1/1-4/Generics4.cs b/Listings/Chapter1/1-4/Generics4.cs new file mode 100644 index 0000000..5ea5ad3 --- /dev/null +++ b/Listings/Chapter1/1-4/Generics4.cs @@ -0,0 +1,32 @@ +using System; + +// MyList +public class MyList { + + public void Add(ItemType obj) { + // ... + } + + public ItemType this[int index] { + get { + return ItemType.default; + } + } +} + +// MyClass +public class MyClass { +} + +// Main +public class MainClass { + + public static void Main() { + + MyList myList = new MyList(); + myList.Add(3); + int myValue = myList[0]; + + Console.Read(); + } +} \ No newline at end of file diff --git a/Listings/Chapter1/1-5/Generics5.cs b/Listings/Chapter1/1-5/Generics5.cs new file mode 100644 index 0000000..8cbd46a --- /dev/null +++ b/Listings/Chapter1/1-5/Generics5.cs @@ -0,0 +1,15 @@ +using System; + +// MyList +public class MyDictionary { + + public void Add(KeyType key, ValueType value) { + // ... + } + + public ValueType this[KeyType key] { + get { + return ValueType.default; + } + } +} diff --git a/Listings/Chapter1/1-6/Generics6.cs b/Listings/Chapter1/1-6/Generics6.cs new file mode 100644 index 0000000..8274211 --- /dev/null +++ b/Listings/Chapter1/1-6/Generics6.cs @@ -0,0 +1,15 @@ +using System; + +// MyList +public class MyDictionary { + + public void Add(KeyType key, ValueType value) { + + switch(((IComparable) key).CompareTo(123)) + { + case 0: + // ... + break; + } + } +} diff --git a/Listings/Chapter1/1-7/Generics7.cs b/Listings/Chapter1/1-7/Generics7.cs new file mode 100644 index 0000000..86bd147 --- /dev/null +++ b/Listings/Chapter1/1-7/Generics7.cs @@ -0,0 +1,17 @@ +using System; + +// MyList +public class MyDictionary + where KeyType : IComparable +{ + + public void Add(KeyType key, ValueType value) { + + switch(((IComparable) key).CompareTo(123)) + { + case 0: + // ... + break; + } + } +} diff --git a/Listings/Chapter1/1-8/Generics8.cs b/Listings/Chapter1/1-8/Generics8.cs new file mode 100644 index 0000000..6a8affe --- /dev/null +++ b/Listings/Chapter1/1-8/Generics8.cs @@ -0,0 +1,10 @@ +using System; + +// MyClass +public class MyClass { + + protected ItemType MyMethod(ItemType item) + { + return item; + } +} diff --git a/Listings/Chapter1/1-9/Iterators1.cs b/Listings/Chapter1/1-9/Iterators1.cs new file mode 100644 index 0000000..e642691 --- /dev/null +++ b/Listings/Chapter1/1-9/Iterators1.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; + +public class Names { + + public IEnumerator GetEnumerator() { + yield "Smith"; + yield "Miller"; + yield "Doe"; + } +} + +// Main +public class MainClass { + + public static void Main() { + Names names = new Names(); + + foreach(string name in names) { + Console.WriteLine(name); + } + + Console.Read(); + } +} \ No newline at end of file diff --git a/Listings/Chapter10/AdRotator.aspx b/Listings/Chapter10/AdRotator.aspx new file mode 100644 index 0000000..6423437 --- /dev/null +++ b/Listings/Chapter10/AdRotator.aspx @@ -0,0 +1,25 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + diff --git a/Listings/Chapter10/Advertisements/ads_tall.xml b/Listings/Chapter10/Advertisements/ads_tall.xml new file mode 100644 index 0000000..194e5f1 --- /dev/null +++ b/Listings/Chapter10/Advertisements/ads_tall.xml @@ -0,0 +1,41 @@ + + + + + joesflowers.jpg + http://www.microsoft.com + http://www.microsoft.net + Orange + 80 + Red Joe Flower + + + + joesflowers2.jpg + http://www.microsoft.com + http://www.microsoft.net + Purple + 80 + Blue Joe Flower + + + + joesflowers3.jpg + http://www.microsoft.com + http://www.microsoft.net + Purple + 80 + White Joe Flower + + + + buyhardware.jpg + http://www.microsoft.com + http://www.microsoft.net + Purple + 80 + Buy Hardware + + + + diff --git a/Listings/Chapter10/Advertisements/buyhardware.jpg b/Listings/Chapter10/Advertisements/buyhardware.jpg new file mode 100644 index 0000000..a8c8c4f Binary files /dev/null and b/Listings/Chapter10/Advertisements/buyhardware.jpg differ diff --git a/Listings/Chapter10/Advertisements/joesflowers.jpg b/Listings/Chapter10/Advertisements/joesflowers.jpg new file mode 100644 index 0000000..9a4defd Binary files /dev/null and b/Listings/Chapter10/Advertisements/joesflowers.jpg differ diff --git a/Listings/Chapter10/Advertisements/joesflowers2.jpg b/Listings/Chapter10/Advertisements/joesflowers2.jpg new file mode 100644 index 0000000..1fb94bb Binary files /dev/null and b/Listings/Chapter10/Advertisements/joesflowers2.jpg differ diff --git a/Listings/Chapter10/Advertisements/joesflowers3.jpg b/Listings/Chapter10/Advertisements/joesflowers3.jpg new file mode 100644 index 0000000..7ec5281 Binary files /dev/null and b/Listings/Chapter10/Advertisements/joesflowers3.jpg differ diff --git a/Listings/Chapter10/Buttons.aspx b/Listings/Chapter10/Buttons.aspx new file mode 100644 index 0000000..b83d238 --- /dev/null +++ b/Listings/Chapter10/Buttons.aspx @@ -0,0 +1,23 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+   +
+
+ Click me, too +
+ + + + diff --git a/Listings/Chapter10/Code/ImageCounter.cs b/Listings/Chapter10/Code/ImageCounter.cs new file mode 100644 index 0000000..2b52f26 --- /dev/null +++ b/Listings/Chapter10/Code/ImageCounter.cs @@ -0,0 +1,51 @@ +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +[assembly:TagPrefix("PGK.Web.UI.WebControls.ImageCounter", "PGK")] + +namespace PGK.Web.UI.WebControls.ImageCounter { + + public class ImageCounter: CompositeControl { + + protected DynamicImage dynamicImage; + + protected override void CreateChildControls() { + this.dynamicImage = new DynamicImage(); + this.Controls.Add(this.dynamicImage); + } + + protected override void OnPreRender(EventArgs e) { + this.dynamicImage.Image = this.GenerateImage(); + base.OnPreRender(e); + } + + protected virtual System.Drawing.Image GenerateImage() { + int count = this.GetCounterValue(); + + Bitmap bitmap = new Bitmap(100, 40); + Graphics g = Graphics.FromImage(bitmap); + g.Clear(Color.White); + + Font font = new Font("Tahoma", 20); + g.DrawString(count.ToString(), font, new SolidBrush(Color.Black), new Point(0, 0)); + + g.Flush(); + + return bitmap; + } + + protected virtual int GetCounterValue() { + if (this.DesignMode == false) { + SiteCounters counters = this.Page.SiteCounters; + counters.FlushAll(); + return counters.GetTotalCount(DateTime.MinValue, DateTime.MaxValue, "PageCounters", null, null, null, null, this.Context.Request.Url.PathAndQuery); + } else { + return 123; + } + } + } +} \ No newline at end of file diff --git a/Listings/Chapter10/Data/ASPNetDB.mdb b/Listings/Chapter10/Data/ASPNetDB.mdb new file mode 100644 index 0000000..0e769c1 Binary files /dev/null and b/Listings/Chapter10/Data/ASPNetDB.mdb differ diff --git a/Listings/Chapter10/HyperLink.aspx b/Listings/Chapter10/HyperLink.aspx new file mode 100644 index 0000000..27dda7c --- /dev/null +++ b/Listings/Chapter10/HyperLink.aspx @@ -0,0 +1,18 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ Even HyperLinks are tracked + +
+ + diff --git a/Listings/Chapter10/ImageCounter.aspx b/Listings/Chapter10/ImageCounter.aspx new file mode 100644 index 0000000..e9f2275 --- /dev/null +++ b/Listings/Chapter10/ImageCounter.aspx @@ -0,0 +1,17 @@ +<%@ page language="C#" %> +<%@ register namespace="PGK.Web.UI.WebControls.ImageCounter" tagprefix="PGK" %> + + + + + + Untitled Page + + +
Counter:
+ + + + diff --git a/Listings/Chapter10/Stats.aspx b/Listings/Chapter10/Stats.aspx new file mode 100644 index 0000000..bb3cf51 --- /dev/null +++ b/Listings/Chapter10/Stats.aspx @@ -0,0 +1,50 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+

+ + Buttons + HyperLinks + Ads + PageCounters + + +

+

+ + + + + + + + + + + + + + + + +

+
+ + diff --git a/Listings/Chapter10/Web.config b/Listings/Chapter10/Web.config new file mode 100644 index 0000000..7d7d271 --- /dev/null +++ b/Listings/Chapter10/Web.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Listings/Chapter11/ClientScripting/ClientCallback.aspx b/Listings/Chapter11/ClientScripting/ClientCallback.aspx new file mode 100644 index 0000000..236702c --- /dev/null +++ b/Listings/Chapter11/ClientScripting/ClientCallback.aspx @@ -0,0 +1,40 @@ +<%@ page language="C#" %> +<%@ implements interface="System.Web.UI.ICallbackEventHandler"%> + + + + + + + + Untitled Page + + +
+ + +
+ + diff --git a/Listings/Chapter11/ClientScripting/Scripting.aspx b/Listings/Chapter11/ClientScripting/Scripting.aspx new file mode 100644 index 0000000..7a61778 --- /dev/null +++ b/Listings/Chapter11/ClientScripting/Scripting.aspx @@ -0,0 +1,18 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ +
+ + diff --git a/Listings/Chapter11/Controls/BulletedList/Books.xml b/Listings/Chapter11/Controls/BulletedList/Books.xml new file mode 100644 index 0000000..c79836d --- /dev/null +++ b/Listings/Chapter11/Controls/BulletedList/Books.xml @@ -0,0 +1,45 @@ + + + + + The Iliad and The Odyssey + 12.95 + + + Best translation I've read. + + + I like other versions better. + + + + + Anthology of World Literature + 24.95 + + + Needs more modern literature. + + + Excellent overview of world literature. + + + + + + + Computer Dictionary + 24.95 + + A valuable resource. + + + + Cooking on a Budget + 23.95 + + Delicious! + + + + diff --git a/Listings/Chapter11/Controls/BulletedList/BulletedList.aspx b/Listings/Chapter11/Controls/BulletedList/BulletedList.aspx new file mode 100644 index 0000000..9115b60 --- /dev/null +++ b/Listings/Chapter11/Controls/BulletedList/BulletedList.aspx @@ -0,0 +1,54 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+

+ + First value + Second value + Third value + +

+ +

+ + First value + Second value + Third value + +

+ +

+ + + +
+ + +

+
+ + diff --git a/Listings/Chapter11/Controls/BulletedList/arrow.gif b/Listings/Chapter11/Controls/BulletedList/arrow.gif new file mode 100644 index 0000000..60dbef5 Binary files /dev/null and b/Listings/Chapter11/Controls/BulletedList/arrow.gif differ diff --git a/Listings/Chapter11/Controls/DynamicImage/CircleGenerator.asix b/Listings/Chapter11/Controls/DynamicImage/CircleGenerator.asix new file mode 100644 index 0000000..76378bd --- /dev/null +++ b/Listings/Chapter11/Controls/DynamicImage/CircleGenerator.asix @@ -0,0 +1,41 @@ +<%@ Image class="CircleGenerator" Language="C#" %> + +using System; +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Drawing.Imaging; +using System.Web.UI.Imaging; + +public class CircleGenerator : ImageGenerator +{ + protected override void RenderImage(Graphics g) + { + int width = (int)Style.Width.Value; + int height = (int)Style.Height.Value; + int w = Math.Max(DefaultWidth, width); + int h = Math.Max(DefaultHeight, height); + + g.FillRectangle(Brushes.White, g.ClipBounds); + + int numberOfCircles = 1; + + if (Parameters["NumberOfCircles"] != null) + { + numberOfCircles = Int32.Parse(Parameters["NumberOfCircles"].ToString()); + } + + g.SmoothingMode = SmoothingMode.AntiAlias; + Random random = new Random(); + + for (int i = 0; i < numberOfCircles; i++) + { + int x = random.Next(w); + int y = random.Next(h); + int circleWidth = random.Next(w/2); + int circleHeight = random.Next(h/2); + int penWidth = random.Next(5); + Color c = Color.FromArgb(random.Next(255),random.Next(255),random.Next(255)); + g.DrawEllipse(new Pen(c,penWidth),x,y,circleWidth,circleHeight); + } + } +} \ No newline at end of file diff --git a/Listings/Chapter11/Controls/DynamicImage/DynamicImage1.aspx b/Listings/Chapter11/Controls/DynamicImage/DynamicImage1.aspx new file mode 100644 index 0000000..7c5b4f5 --- /dev/null +++ b/Listings/Chapter11/Controls/DynamicImage/DynamicImage1.aspx @@ -0,0 +1,19 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +
+ + diff --git a/Listings/Chapter11/Controls/DynamicImage/DynamicImage2.aspx b/Listings/Chapter11/Controls/DynamicImage/DynamicImage2.aspx new file mode 100644 index 0000000..b7c4e0a --- /dev/null +++ b/Listings/Chapter11/Controls/DynamicImage/DynamicImage2.aspx @@ -0,0 +1,31 @@ +<%@ page language="C#" %> +<%@ import namespace="System.IO" %> + + + + + + Untitled Page + + +
+ + + + + + +
+ + diff --git a/Listings/Chapter11/Controls/DynamicImage/DynamicImage3.aspx b/Listings/Chapter11/Controls/DynamicImage/DynamicImage3.aspx new file mode 100644 index 0000000..bcf7c81 --- /dev/null +++ b/Listings/Chapter11/Controls/DynamicImage/DynamicImage3.aspx @@ -0,0 +1,47 @@ +<%@ page language="C#" %> +<%@ import namespace="System.Drawing" %> + + + + + + Untitled Page + + +
+ This picture was created dynamically:

+ + + + diff --git a/Listings/Chapter11/Controls/DynamicImage/DynamicImage4.aspx b/Listings/Chapter11/Controls/DynamicImage/DynamicImage4.aspx new file mode 100644 index 0000000..0226ee5 --- /dev/null +++ b/Listings/Chapter11/Controls/DynamicImage/DynamicImage4.aspx @@ -0,0 +1,28 @@ +<%@ page language="C#"%> + + + +
+ + + + + +
+ Number of circles:
+
+ +
+ + + + + + +
+
+ + diff --git a/Listings/Chapter11/Controls/DynamicImage/bigsur_rp.gif b/Listings/Chapter11/Controls/DynamicImage/bigsur_rp.gif new file mode 100644 index 0000000..582922e Binary files /dev/null and b/Listings/Chapter11/Controls/DynamicImage/bigsur_rp.gif differ diff --git a/Listings/Chapter11/Controls/DynamicImage/hollywood-sign.gif b/Listings/Chapter11/Controls/DynamicImage/hollywood-sign.gif new file mode 100644 index 0000000..8b540b8 Binary files /dev/null and b/Listings/Chapter11/Controls/DynamicImage/hollywood-sign.gif differ diff --git a/Listings/Chapter11/Controls/DynamicImage/paramount.gif b/Listings/Chapter11/Controls/DynamicImage/paramount.gif new file mode 100644 index 0000000..9ed8a31 Binary files /dev/null and b/Listings/Chapter11/Controls/DynamicImage/paramount.gif differ diff --git a/Listings/Chapter11/Controls/DynamicImage/vivendi-universal.gif b/Listings/Chapter11/Controls/DynamicImage/vivendi-universal.gif new file mode 100644 index 0000000..dd97050 Binary files /dev/null and b/Listings/Chapter11/Controls/DynamicImage/vivendi-universal.gif differ diff --git a/Listings/Chapter11/Controls/FileUpload/FileUpload.aspx b/Listings/Chapter11/Controls/FileUpload/FileUpload.aspx new file mode 100644 index 0000000..86feaac --- /dev/null +++ b/Listings/Chapter11/Controls/FileUpload/FileUpload.aspx @@ -0,0 +1,31 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +
+
+ + + + + + diff --git a/Listings/Chapter11/Controls/HiddenField/HiddenField.aspx b/Listings/Chapter11/Controls/HiddenField/HiddenField.aspx new file mode 100644 index 0000000..245c1e5 --- /dev/null +++ b/Listings/Chapter11/Controls/HiddenField/HiddenField.aspx @@ -0,0 +1,20 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + diff --git a/Listings/Chapter11/Controls/ImageMap/ImageMap.aspx b/Listings/Chapter11/Controls/ImageMap/ImageMap.aspx new file mode 100644 index 0000000..e0f75bd --- /dev/null +++ b/Listings/Chapter11/Controls/ImageMap/ImageMap.aspx @@ -0,0 +1,35 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+ + + +
+ + diff --git a/Listings/Chapter11/Controls/ImageMap/paramount.gif b/Listings/Chapter11/Controls/ImageMap/paramount.gif new file mode 100644 index 0000000..9ed8a31 Binary files /dev/null and b/Listings/Chapter11/Controls/ImageMap/paramount.gif differ diff --git a/Listings/Chapter11/Controls/MultiView/MultiView.aspx b/Listings/Chapter11/Controls/MultiView/MultiView.aspx new file mode 100644 index 0000000..73b2c2e --- /dev/null +++ b/Listings/Chapter11/Controls/MultiView/MultiView.aspx @@ -0,0 +1,35 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + Please enter your name: +
+
+ + + +
+ + Your name is + Label + +
  + +
+ + diff --git a/Listings/Chapter11/Controls/Pager/Pager.aspx b/Listings/Chapter11/Controls/Pager/Pager.aspx new file mode 100644 index 0000000..f0f4dba --- /dev/null +++ b/Listings/Chapter11/Controls/Pager/Pager.aspx @@ -0,0 +1,30 @@ +<%@ page language="C#" %> + + + + + + + +
+ +

Pager Class Example

+ + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter11/Controls/Panel/Panel.aspx b/Listings/Chapter11/Controls/Panel/Panel.aspx new file mode 100644 index 0000000..7b57d84 --- /dev/null +++ b/Listings/Chapter11/Controls/Panel/Panel.aspx @@ -0,0 +1,27 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + +
+ + diff --git a/Listings/Chapter11/Controls/Substitution/Substitution.aspx b/Listings/Chapter11/Controls/Substitution/Substitution.aspx new file mode 100644 index 0000000..e6e2214 --- /dev/null +++ b/Listings/Chapter11/Controls/Substitution/Substitution.aspx @@ -0,0 +1,28 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ Some text goes here. +
+
+ +
+
+ Some other text goes here. + + + \ No newline at end of file diff --git a/Listings/Chapter11/Controls/TextBox/TextBox.aspx b/Listings/Chapter11/Controls/TextBox/TextBox.aspx new file mode 100644 index 0000000..883a27a --- /dev/null +++ b/Listings/Chapter11/Controls/TextBox/TextBox.aspx @@ -0,0 +1,16 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ Email: + + + diff --git a/Listings/Chapter11/Controls/Wizard/Wizard.aspx b/Listings/Chapter11/Controls/Wizard/Wizard.aspx new file mode 100644 index 0000000..4f41a16 --- /dev/null +++ b/Listings/Chapter11/Controls/Wizard/Wizard.aspx @@ -0,0 +1,42 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + Hello!
+
+ Please enter your name: + + +
+
+ + Thanks,
+
+ your name is + + +
+
+
+
+ + diff --git a/Listings/Chapter11/PageFramework/@PageProperties/Code/TitledPage.cs b/Listings/Chapter11/PageFramework/@PageProperties/Code/TitledPage.cs new file mode 100644 index 0000000..e30945b --- /dev/null +++ b/Listings/Chapter11/PageFramework/@PageProperties/Code/TitledPage.cs @@ -0,0 +1,12 @@ +using System; + +public class TitledPage : System.Web.UI.Page { + + private string title; + + + public string Title { + get { return this.title; } + set { this.title = value; } + } +} diff --git a/Listings/Chapter11/PageFramework/@PageProperties/ContentPage5.aspx b/Listings/Chapter11/PageFramework/@PageProperties/ContentPage5.aspx new file mode 100644 index 0000000..f3aeed7 --- /dev/null +++ b/Listings/Chapter11/PageFramework/@PageProperties/ContentPage5.aspx @@ -0,0 +1,8 @@ +<%@ page language="C#" inherits="TitledPage" master="~/MasterPage5.master" Title="Hello World!" %> + + + + Just a simple content page + diff --git a/Listings/Chapter11/PageFramework/@PageProperties/MasterPage5.master b/Listings/Chapter11/PageFramework/@PageProperties/MasterPage5.master new file mode 100644 index 0000000..72ce729 --- /dev/null +++ b/Listings/Chapter11/PageFramework/@PageProperties/MasterPage5.master @@ -0,0 +1,22 @@ +<%@ master language="C#" %> + + + + + + <ASP:Literal id="LT_HtmlTitle" runat="server" /> + + +
+ + +
+ + diff --git a/Listings/Chapter11/PageFramework/DefaultButton.aspx b/Listings/Chapter11/PageFramework/DefaultButton.aspx new file mode 100644 index 0000000..08c52a5 --- /dev/null +++ b/Listings/Chapter11/PageFramework/DefaultButton.aspx @@ -0,0 +1,23 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + diff --git a/Listings/Chapter11/PageFramework/Focus.aspx b/Listings/Chapter11/PageFramework/Focus.aspx new file mode 100644 index 0000000..7c7f431 --- /dev/null +++ b/Listings/Chapter11/PageFramework/Focus.aspx @@ -0,0 +1,38 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + +
+
+
+ + + + + diff --git a/Listings/Chapter11/PageFramework/Metadata.aspx b/Listings/Chapter11/PageFramework/Metadata.aspx new file mode 100644 index 0000000..efae436 --- /dev/null +++ b/Listings/Chapter11/PageFramework/Metadata.aspx @@ -0,0 +1,21 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ +
+ + diff --git a/Listings/Chapter11/PageFramework/crosspost1.aspx b/Listings/Chapter11/PageFramework/crosspost1.aspx new file mode 100644 index 0000000..742326c --- /dev/null +++ b/Listings/Chapter11/PageFramework/crosspost1.aspx @@ -0,0 +1,54 @@ +<%@ page language="C#" %> + + + + + +
+ Enter Name: + + +
+
+ Pick Date: +
+
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+ + + diff --git a/Listings/Chapter11/PageFramework/crosspost2.aspx b/Listings/Chapter11/PageFramework/crosspost2.aspx new file mode 100644 index 0000000..f38b8a8 --- /dev/null +++ b/Listings/Chapter11/PageFramework/crosspost2.aspx @@ -0,0 +1,21 @@ +<%@ page language="C#" %> + + + + + +
+ +
+ + + diff --git a/Listings/Chapter11/PageFramework/crosspost3.aspx b/Listings/Chapter11/PageFramework/crosspost3.aspx new file mode 100644 index 0000000..745d091 --- /dev/null +++ b/Listings/Chapter11/PageFramework/crosspost3.aspx @@ -0,0 +1,66 @@ +<%@ page language="C#" %> + + + + + +
+ Enter Name: + + +
+
+ Pick Date: +
+
+ + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + +
+
+ + + diff --git a/Listings/Chapter11/PageFramework/crosspost4.aspx b/Listings/Chapter11/PageFramework/crosspost4.aspx new file mode 100644 index 0000000..fbf135b --- /dev/null +++ b/Listings/Chapter11/PageFramework/crosspost4.aspx @@ -0,0 +1,22 @@ +<%@ page language="C#" %> +<%@ previouspage virtualpath="crosspost3.aspx" %> + + + + + +
+ +
+ + + diff --git a/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation1.aspx b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation1.aspx new file mode 100644 index 0000000..c2b7089 --- /dev/null +++ b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation1.aspx @@ -0,0 +1,50 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation2.aspx b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation2.aspx new file mode 100644 index 0000000..a2d05f9 --- /dev/null +++ b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation2.aspx @@ -0,0 +1,58 @@ +<%@ page language="C#" %> +<%@ import namespace="System.Data" %> +<%@ import namespace="System.Data.SqlClient" %> + + + + + + Untitled Page + + +
+

+ + +

+

+ Last update: + + +

+
+ + diff --git a/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation3.aspx b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation3.aspx new file mode 100644 index 0000000..977c894 --- /dev/null +++ b/Listings/Chapter11/SqlCacheInvalidation/SqlCacheInvalidation3.aspx @@ -0,0 +1,60 @@ +<%@ page language="C#" %> +<%@ outputcache duration="600" varybyparam="none" sqldependency="Northwind:Customers" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ Last update: + +

+
+ + diff --git a/Listings/Chapter11/SqlCacheInvalidation/web.config b/Listings/Chapter11/SqlCacheInvalidation/web.config new file mode 100644 index 0000000..d522d3e --- /dev/null +++ b/Listings/Chapter11/SqlCacheInvalidation/web.config @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter11/Validation/Validation.aspx b/Listings/Chapter11/Validation/Validation.aspx new file mode 100644 index 0000000..90b904a --- /dev/null +++ b/Listings/Chapter11/Validation/Validation.aspx @@ -0,0 +1,38 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+

First form

+

+ + + *** +
+
+ +

+ + +

Second form

+

+ + + *** +
+
+ +

+ +
+ + diff --git a/Listings/Chapter12/Mobile1.aspx b/Listings/Chapter12/Mobile1.aspx new file mode 100644 index 0000000..0d50d47 --- /dev/null +++ b/Listings/Chapter12/Mobile1.aspx @@ -0,0 +1,26 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+

Please enter your name: +

+ + +

+

+
+ + diff --git a/Listings/Chapter12/MultiView.aspx b/Listings/Chapter12/MultiView.aspx new file mode 100644 index 0000000..af2721c --- /dev/null +++ b/Listings/Chapter12/MultiView.aspx @@ -0,0 +1,43 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +

+ Please enter your name: +

+ + +

+
+ +

+ +

+ Back +

+
+
+
+ + diff --git a/Listings/Chapter12/Pager.aspx b/Listings/Chapter12/Pager.aspx new file mode 100644 index 0000000..b09ff8b --- /dev/null +++ b/Listings/Chapter12/Pager.aspx @@ -0,0 +1,32 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + +
+ Phone: + +
+
+
+ + +
+ + diff --git a/Listings/Chapter12/PhoneLink.aspx b/Listings/Chapter12/PhoneLink.aspx new file mode 100644 index 0000000..e731fc3 --- /dev/null +++ b/Listings/Chapter12/PhoneLink.aspx @@ -0,0 +1,20 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + Call me! + +
+ + diff --git a/Listings/Chapter13/Accessing/AppSettings1.aspx b/Listings/Chapter13/Accessing/AppSettings1.aspx new file mode 100644 index 0000000..e5641be --- /dev/null +++ b/Listings/Chapter13/Accessing/AppSettings1.aspx @@ -0,0 +1,28 @@ + <%@ page language="C#" %> + <%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter13/Accessing/AppSettings2.aspx b/Listings/Chapter13/Accessing/AppSettings2.aspx new file mode 100644 index 0000000..0070981 --- /dev/null +++ b/Listings/Chapter13/Accessing/AppSettings2.aspx @@ -0,0 +1,23 @@ + <%@ page language="C#" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter13/Accessing/Configuration1.aspx b/Listings/Chapter13/Accessing/Configuration1.aspx new file mode 100644 index 0000000..b2a66eb --- /dev/null +++ b/Listings/Chapter13/Accessing/Configuration1.aspx @@ -0,0 +1,44 @@ +<%@ page language="C#" %> +<%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + +
+ + + Action: +
+ Users: + + <%# Container.DataItem %> + - + +
+ Roles: + + <%# Container.DataItem %> + - + +
+
+ +
+ + diff --git a/Listings/Chapter13/Accessing/Configuration2.aspx b/Listings/Chapter13/Accessing/Configuration2.aspx new file mode 100644 index 0000000..c34b469 --- /dev/null +++ b/Listings/Chapter13/Accessing/Configuration2.aspx @@ -0,0 +1,33 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +
+ + diff --git a/Listings/Chapter13/Accessing/Configuration3.aspx b/Listings/Chapter13/Accessing/Configuration3.aspx new file mode 100644 index 0000000..0b3e368 --- /dev/null +++ b/Listings/Chapter13/Accessing/Configuration3.aspx @@ -0,0 +1,26 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + +
+ + diff --git a/Listings/Chapter13/Accessing/ConnectionStrings1.aspx b/Listings/Chapter13/Accessing/ConnectionStrings1.aspx new file mode 100644 index 0000000..c54c6b1 --- /dev/null +++ b/Listings/Chapter13/Accessing/ConnectionStrings1.aspx @@ -0,0 +1,28 @@ + <%@ page language="C#" %> + <%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter13/Accessing/ConnectionStrings2.aspx b/Listings/Chapter13/Accessing/ConnectionStrings2.aspx new file mode 100644 index 0000000..0891862 --- /dev/null +++ b/Listings/Chapter13/Accessing/ConnectionStrings2.aspx @@ -0,0 +1,24 @@ + <%@ page language="C#" %> + <%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter13/Updating/AppSettings3.aspx b/Listings/Chapter13/Updating/AppSettings3.aspx new file mode 100644 index 0000000..ea02439 --- /dev/null +++ b/Listings/Chapter13/Updating/AppSettings3.aspx @@ -0,0 +1,31 @@ + <%@ page language="C#" %> + <%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter13/Updating/Configuration4.aspx b/Listings/Chapter13/Updating/Configuration4.aspx new file mode 100644 index 0000000..225e822 --- /dev/null +++ b/Listings/Chapter13/Updating/Configuration4.aspx @@ -0,0 +1,32 @@ +<%@ page language="C#" %> +<%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + +
+ +
+ + diff --git a/Listings/Chapter13/Updating/Configuration5.aspx b/Listings/Chapter13/Updating/Configuration5.aspx new file mode 100644 index 0000000..c39cffe --- /dev/null +++ b/Listings/Chapter13/Updating/Configuration5.aspx @@ -0,0 +1,28 @@ +<%@ page language="C#" %> +<%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + +
+ +
+ + diff --git a/Listings/Chapter13/Updating/ConnectionStrings3.aspx b/Listings/Chapter13/Updating/ConnectionStrings3.aspx new file mode 100644 index 0000000..7fd4287 --- /dev/null +++ b/Listings/Chapter13/Updating/ConnectionStrings3.aspx @@ -0,0 +1,33 @@ + <%@ page language="C#" %> + <%@ import namespace="System.Web.Management" %> + + + + + + Untitled Page + + + +
+
+ + diff --git a/Listings/Chapter2/GoogleSearchService.wsdl b/Listings/Chapter2/GoogleSearchService.wsdl new file mode 100644 index 0000000..03301c9 --- /dev/null +++ b/Listings/Chapter2/GoogleSearchService.wsdl @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter3/3-10/Code/Person.cs b/Listings/Chapter3/3-10/Code/Person.cs new file mode 100644 index 0000000..f841094 --- /dev/null +++ b/Listings/Chapter3/3-10/Code/Person.cs @@ -0,0 +1,29 @@ +using System; + +public class Person { + + private int id; + private string firstname; + private string lastname; + + public Person(int id, string firstname, string lastname) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + } + + public int Id { + get { return this.id; } + set { this.id = value; } + } + + public string Firstname { + get { return this.firstname; } + set { this.firstname = value; } + } + + public string Lastname { + get { return this.lastname; } + set { this.lastname = value; } + } +} diff --git a/Listings/Chapter3/3-10/Code/PersonCollection.cs b/Listings/Chapter3/3-10/Code/PersonCollection.cs new file mode 100644 index 0000000..3d8d6ae --- /dev/null +++ b/Listings/Chapter3/3-10/Code/PersonCollection.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +public class PersonCollection : List { + + public void Remove(int id) { + Person person = this.FindPersonById(id); + if (person != null) { + base.Remove(person); + } + } + + public Person FindPersonById(int id) { + foreach (Person person in this) { + if (person.Id.Equals(id)) { + return person; + } + } + return null; + } +} diff --git a/Listings/Chapter3/3-10/Code/PersonManager.cs b/Listings/Chapter3/3-10/Code/PersonManager.cs new file mode 100644 index 0000000..72995ee --- /dev/null +++ b/Listings/Chapter3/3-10/Code/PersonManager.cs @@ -0,0 +1,51 @@ +using System; +using System.Web; + +public class PersonManager { + + private const string personsKey = "persons"; + + public PersonCollection SelectPersons() { + HttpContext context = HttpContext.Current; + + if (context.Application[personsKey] == null) { + PersonCollection persons = new PersonCollection(); + + persons.Add(new Person(0, "Patrick", "Lorenz")); + persons.Add(new Person(1, "Micha", "Brunnhuber")); + persons.Add(new Person(2, "Thomas", "Ballmeier")); + context.Application[personsKey] = persons; + } + + return (context.Application[personsKey] as PersonCollection); + } + + public Person SelectPerson(int id) { + return this.SelectPersons().FindPersonById(id); + } + + public void DeletePerson(int Id) { + HttpContext context = HttpContext.Current; + PersonCollection persons = (context.Application[personsKey] as PersonCollection); + + persons.Remove(Id); + } + + public void Update(int Id, string Firstname, string Lastname) { + HttpContext context = HttpContext.Current; + PersonCollection persons = (context.Application[personsKey] as PersonCollection); + Person person = persons.FindPersonById(Id); + + if (person != null) { + person.Firstname = Firstname; + person.Lastname = Lastname; + } + } + + public void Insert(int Id, string Firstname, string Lastname) { + HttpContext context = HttpContext.Current; + PersonCollection persons = (context.Application[personsKey] as PersonCollection); + + persons.Add(new Person(Id, Firstname, Lastname)); + } +} diff --git a/Listings/Chapter3/3-10/ObjectDataSource4.aspx b/Listings/Chapter3/3-10/ObjectDataSource4.aspx new file mode 100644 index 0000000..fc2ed8a --- /dev/null +++ b/Listings/Chapter3/3-10/ObjectDataSource4.aspx @@ -0,0 +1,69 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/3-6/Code/Person.cs b/Listings/Chapter3/3-6/Code/Person.cs new file mode 100644 index 0000000..f841094 --- /dev/null +++ b/Listings/Chapter3/3-6/Code/Person.cs @@ -0,0 +1,29 @@ +using System; + +public class Person { + + private int id; + private string firstname; + private string lastname; + + public Person(int id, string firstname, string lastname) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + } + + public int Id { + get { return this.id; } + set { this.id = value; } + } + + public string Firstname { + get { return this.firstname; } + set { this.firstname = value; } + } + + public string Lastname { + get { return this.lastname; } + set { this.lastname = value; } + } +} diff --git a/Listings/Chapter3/3-6/Code/PersonCollection.cs b/Listings/Chapter3/3-6/Code/PersonCollection.cs new file mode 100644 index 0000000..3d8d6ae --- /dev/null +++ b/Listings/Chapter3/3-6/Code/PersonCollection.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +public class PersonCollection : List { + + public void Remove(int id) { + Person person = this.FindPersonById(id); + if (person != null) { + base.Remove(person); + } + } + + public Person FindPersonById(int id) { + foreach (Person person in this) { + if (person.Id.Equals(id)) { + return person; + } + } + return null; + } +} diff --git a/Listings/Chapter3/3-6/Code/PersonManager.cs b/Listings/Chapter3/3-6/Code/PersonManager.cs new file mode 100644 index 0000000..d620676 --- /dev/null +++ b/Listings/Chapter3/3-6/Code/PersonManager.cs @@ -0,0 +1,22 @@ +using System; +using System.Web; + +public class PersonManager { + + private const string personsKey = "persons"; + + public PersonCollection SelectPersons() { + HttpContext context = HttpContext.Current; + + if (context.Application[personsKey] == null) { + PersonCollection persons = new PersonCollection(); + + persons.Add(new Person(0, "Patrick", "Lorenz")); + persons.Add(new Person(1, "Micha", "Brunnhuber")); + persons.Add(new Person(2, "Thomas", "Ballmeier")); + context.Application[personsKey] = persons; + } + + return (context.Application[personsKey] as PersonCollection); + } +} diff --git a/Listings/Chapter3/3-6/ObjectDataSource1.aspx b/Listings/Chapter3/3-6/ObjectDataSource1.aspx new file mode 100644 index 0000000..35921ad --- /dev/null +++ b/Listings/Chapter3/3-6/ObjectDataSource1.aspx @@ -0,0 +1,38 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/3-8/Code/Person.cs b/Listings/Chapter3/3-8/Code/Person.cs new file mode 100644 index 0000000..f841094 --- /dev/null +++ b/Listings/Chapter3/3-8/Code/Person.cs @@ -0,0 +1,29 @@ +using System; + +public class Person { + + private int id; + private string firstname; + private string lastname; + + public Person(int id, string firstname, string lastname) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + } + + public int Id { + get { return this.id; } + set { this.id = value; } + } + + public string Firstname { + get { return this.firstname; } + set { this.firstname = value; } + } + + public string Lastname { + get { return this.lastname; } + set { this.lastname = value; } + } +} diff --git a/Listings/Chapter3/3-8/Code/PersonCollection.cs b/Listings/Chapter3/3-8/Code/PersonCollection.cs new file mode 100644 index 0000000..3d8d6ae --- /dev/null +++ b/Listings/Chapter3/3-8/Code/PersonCollection.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +public class PersonCollection : List { + + public void Remove(int id) { + Person person = this.FindPersonById(id); + if (person != null) { + base.Remove(person); + } + } + + public Person FindPersonById(int id) { + foreach (Person person in this) { + if (person.Id.Equals(id)) { + return person; + } + } + return null; + } +} diff --git a/Listings/Chapter3/3-8/Code/PersonManager.cs b/Listings/Chapter3/3-8/Code/PersonManager.cs new file mode 100644 index 0000000..9d9fc83 --- /dev/null +++ b/Listings/Chapter3/3-8/Code/PersonManager.cs @@ -0,0 +1,26 @@ +using System; +using System.Web; + +public class PersonManager { + + private const string personsKey = "persons"; + + public PersonCollection SelectPersons() { + HttpContext context = HttpContext.Current; + + if (context.Application[personsKey] == null) { + PersonCollection persons = new PersonCollection(); + + persons.Add(new Person(0, "Patrick", "Lorenz")); + persons.Add(new Person(1, "Micha", "Brunnhuber")); + persons.Add(new Person(2, "Thomas", "Ballmeier")); + context.Application[personsKey] = persons; + } + + return (context.Application[personsKey] as PersonCollection); + } + + public Person SelectPerson(int id) { + return this.SelectPersons().FindPersonById(id); + } +} diff --git a/Listings/Chapter3/3-8/ObjectDataSource2.aspx b/Listings/Chapter3/3-8/ObjectDataSource2.aspx new file mode 100644 index 0000000..d82692d --- /dev/null +++ b/Listings/Chapter3/3-8/ObjectDataSource2.aspx @@ -0,0 +1,23 @@ +<%@ page language="C#" %> + + + + Untitled Page + + +
+ ID:  0 + +
+
+ + + + + + + + + + + diff --git a/Listings/Chapter3/3-9/Code/Person.cs b/Listings/Chapter3/3-9/Code/Person.cs new file mode 100644 index 0000000..f841094 --- /dev/null +++ b/Listings/Chapter3/3-9/Code/Person.cs @@ -0,0 +1,29 @@ +using System; + +public class Person { + + private int id; + private string firstname; + private string lastname; + + public Person(int id, string firstname, string lastname) { + this.id = id; + this.firstname = firstname; + this.lastname = lastname; + } + + public int Id { + get { return this.id; } + set { this.id = value; } + } + + public string Firstname { + get { return this.firstname; } + set { this.firstname = value; } + } + + public string Lastname { + get { return this.lastname; } + set { this.lastname = value; } + } +} diff --git a/Listings/Chapter3/3-9/Code/PersonCollection.cs b/Listings/Chapter3/3-9/Code/PersonCollection.cs new file mode 100644 index 0000000..3d8d6ae --- /dev/null +++ b/Listings/Chapter3/3-9/Code/PersonCollection.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; + +public class PersonCollection : List { + + public void Remove(int id) { + Person person = this.FindPersonById(id); + if (person != null) { + base.Remove(person); + } + } + + public Person FindPersonById(int id) { + foreach (Person person in this) { + if (person.Id.Equals(id)) { + return person; + } + } + return null; + } +} diff --git a/Listings/Chapter3/3-9/Code/PersonManager.cs b/Listings/Chapter3/3-9/Code/PersonManager.cs new file mode 100644 index 0000000..314a8cb --- /dev/null +++ b/Listings/Chapter3/3-9/Code/PersonManager.cs @@ -0,0 +1,44 @@ +using System; +using System.Web; + +public class PersonManager { + + private const string personsKey = "persons"; + + public PersonCollection SelectPersons() { + HttpContext context = HttpContext.Current; + + if (context.Application[personsKey] == null) { + PersonCollection persons = new PersonCollection(); + + persons.Add(new Person(0, "Patrick", "Lorenz")); + persons.Add(new Person(1, "Micha", "Brunnhuber")); + persons.Add(new Person(2, "Thomas", "Ballmeier")); + context.Application[personsKey] = persons; + } + + return (context.Application[personsKey] as PersonCollection); + } + + public Person SelectPerson(int id) { + return this.SelectPersons().FindPersonById(id); + } + + public void DeletePerson(int Id) { + HttpContext context = HttpContext.Current; + PersonCollection persons = (context.Application[personsKey] as PersonCollection); + + persons.Remove(Id); + } + + public void Update(int Id, string Firstname, string Lastname) { + HttpContext context = HttpContext.Current; + PersonCollection persons = (context.Application[personsKey] as PersonCollection); + Person person = persons.FindPersonById(Id); + + if (person != null) { + person.Firstname = Firstname; + person.Lastname = Lastname; + } + } +} diff --git a/Listings/Chapter3/3-9/ObjectDataSource3.aspx b/Listings/Chapter3/3-9/ObjectDataSource3.aspx new file mode 100644 index 0000000..bae20d7 --- /dev/null +++ b/Listings/Chapter3/3-9/ObjectDataSource3.aspx @@ -0,0 +1,46 @@ +<%@ page language="C#" %> + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/Books.xml b/Listings/Chapter3/Books.xml new file mode 100644 index 0000000..c79836d --- /dev/null +++ b/Listings/Chapter3/Books.xml @@ -0,0 +1,45 @@ + + + + + The Iliad and The Odyssey + 12.95 + + + Best translation I've read. + + + I like other versions better. + + + + + Anthology of World Literature + 24.95 + + + Needs more modern literature. + + + Excellent overview of world literature. + + + + + + + Computer Dictionary + 24.95 + + A valuable resource. + + + + Cooking on a Budget + 23.95 + + Delicious! + + + + diff --git a/Listings/Chapter3/Caching1.aspx b/Listings/Chapter3/Caching1.aspx new file mode 100644 index 0000000..9327ef4 --- /dev/null +++ b/Listings/Chapter3/Caching1.aspx @@ -0,0 +1,44 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/DataSource1.aspx b/Listings/Chapter3/DataSource1.aspx new file mode 100644 index 0000000..72699f8 --- /dev/null +++ b/Listings/Chapter3/DataSource1.aspx @@ -0,0 +1,25 @@ +<%@ page language="VB" %> + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/DetailsView1.aspx b/Listings/Chapter3/DetailsView1.aspx new file mode 100644 index 0000000..17a6535 --- /dev/null +++ b/Listings/Chapter3/DetailsView1.aspx @@ -0,0 +1,38 @@ +<%@ page language="VB" %> + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/DetailsView2.aspx b/Listings/Chapter3/DetailsView2.aspx new file mode 100644 index 0000000..4823253 --- /dev/null +++ b/Listings/Chapter3/DetailsView2.aspx @@ -0,0 +1,42 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/DetailsView3.aspx b/Listings/Chapter3/DetailsView3.aspx new file mode 100644 index 0000000..1992c5c --- /dev/null +++ b/Listings/Chapter3/DetailsView3.aspx @@ -0,0 +1,52 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Note: This sample won't work, cause CustomerID can't be DBNULL! +
+ + diff --git a/Listings/Chapter3/DetailsView4.aspx b/Listings/Chapter3/DetailsView4.aspx new file mode 100644 index 0000000..efb4e56 --- /dev/null +++ b/Listings/Chapter3/DetailsView4.aspx @@ -0,0 +1,58 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + Company: + +
+ Contact: + +
+ Edit +
+
+ + +
+ + diff --git a/Listings/Chapter3/GridView1.aspx b/Listings/Chapter3/GridView1.aspx new file mode 100644 index 0000000..39e4a65 --- /dev/null +++ b/Listings/Chapter3/GridView1.aspx @@ -0,0 +1,47 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView2.aspx b/Listings/Chapter3/GridView2.aspx new file mode 100644 index 0000000..0db0fdd --- /dev/null +++ b/Listings/Chapter3/GridView2.aspx @@ -0,0 +1,47 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView3.aspx b/Listings/Chapter3/GridView3.aspx new file mode 100644 index 0000000..3c38ea7 --- /dev/null +++ b/Listings/Chapter3/GridView3.aspx @@ -0,0 +1,58 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + Leider sind keine Datensätze vorhanden! + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView4.aspx b/Listings/Chapter3/GridView4.aspx new file mode 100644 index 0000000..3c38ea7 --- /dev/null +++ b/Listings/Chapter3/GridView4.aspx @@ -0,0 +1,58 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + Leider sind keine Datensätze vorhanden! + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView5.aspx b/Listings/Chapter3/GridView5.aspx new file mode 100644 index 0000000..22cb65d --- /dev/null +++ b/Listings/Chapter3/GridView5.aspx @@ -0,0 +1,48 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + Leider sind keine Datensätze vorhanden! + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView6.aspx b/Listings/Chapter3/GridView6.aspx new file mode 100644 index 0000000..df5b9ae --- /dev/null +++ b/Listings/Chapter3/GridView6.aspx @@ -0,0 +1,57 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + Leider sind keine Datensätze vorhanden! + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridView7.aspx b/Listings/Chapter3/GridView7.aspx new file mode 100644 index 0000000..bccc992 --- /dev/null +++ b/Listings/Chapter3/GridView7.aspx @@ -0,0 +1,48 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + Leider sind keine Datensätze vorhanden! + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/GridViewDetailsView1.aspx b/Listings/Chapter3/GridViewDetailsView1.aspx new file mode 100644 index 0000000..a1a78ef --- /dev/null +++ b/Listings/Chapter3/GridViewDetailsView1.aspx @@ -0,0 +1,49 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/Parameters1.aspx b/Listings/Chapter3/Parameters1.aspx new file mode 100644 index 0000000..93fae7c --- /dev/null +++ b/Listings/Chapter3/Parameters1.aspx @@ -0,0 +1,89 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/TreeView1.aspx b/Listings/Chapter3/TreeView1.aspx new file mode 100644 index 0000000..f3aa137 --- /dev/null +++ b/Listings/Chapter3/TreeView1.aspx @@ -0,0 +1,50 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +   + +
+ + diff --git a/Listings/Chapter3/TreeView2.aspx b/Listings/Chapter3/TreeView2.aspx new file mode 100644 index 0000000..2801594 --- /dev/null +++ b/Listings/Chapter3/TreeView2.aspx @@ -0,0 +1,44 @@ +<%@ page language="VB" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter3/TreeView3.aspx b/Listings/Chapter3/TreeView3.aspx new file mode 100644 index 0000000..5049036 --- /dev/null +++ b/Listings/Chapter3/TreeView3.aspx @@ -0,0 +1,60 @@ +<%@ page language="C#" %> +<%@ import namespace="System.IO" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter4/4-1/ContentPage1.aspx b/Listings/Chapter4/4-1/ContentPage1.aspx new file mode 100644 index 0000000..33744be --- /dev/null +++ b/Listings/Chapter4/4-1/ContentPage1.aspx @@ -0,0 +1,8 @@ +<%@ page language="C#" master="~/MasterPage1.master" %> + + + + You can visually edit your content page right within the master ... cool stuff! + diff --git a/Listings/Chapter4/4-1/ContentPage2.aspx b/Listings/Chapter4/4-1/ContentPage2.aspx new file mode 100644 index 0000000..7eaf128 --- /dev/null +++ b/Listings/Chapter4/4-1/ContentPage2.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/MasterPage2.master" Trace="true" %> + + + + Here's some text! + + diff --git a/Listings/Chapter4/4-1/MasterPage1.master b/Listings/Chapter4/4-1/MasterPage1.master new file mode 100644 index 0000000..9e34847 --- /dev/null +++ b/Listings/Chapter4/4-1/MasterPage1.master @@ -0,0 +1,35 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+

My Little Company

+
Navigation? + + +
+ +
+
+ + diff --git a/Listings/Chapter4/4-1/MasterPage2.master b/Listings/Chapter4/4-1/MasterPage2.master new file mode 100644 index 0000000..e152d38 --- /dev/null +++ b/Listings/Chapter4/4-1/MasterPage2.master @@ -0,0 +1,37 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+

My Little Company

+
Navigation? + + +
+   + This is a default content + that can be replaced in any content page +
+
+ + diff --git a/Listings/Chapter4/4-1/Web.Config b/Listings/Chapter4/4-1/Web.Config new file mode 100644 index 0000000..bc02be0 --- /dev/null +++ b/Listings/Chapter4/4-1/Web.Config @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + diff --git a/Listings/Chapter4/4-2/Default.aspx b/Listings/Chapter4/4-2/Default.aspx new file mode 100644 index 0000000..ad41e5c --- /dev/null +++ b/Listings/Chapter4/4-2/Default.aspx @@ -0,0 +1,23 @@ +<%@ page language="C#" master="~/main.master" printcontent:master="~/print.master" %> + + + + Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test + Test Test
+
+ Print + me! +
+ diff --git a/Listings/Chapter4/4-2/Web.Config b/Listings/Chapter4/4-2/Web.Config new file mode 100644 index 0000000..93fe22d --- /dev/null +++ b/Listings/Chapter4/4-2/Web.Config @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + diff --git a/Listings/Chapter4/4-2/main.master b/Listings/Chapter4/4-2/main.master new file mode 100644 index 0000000..d91e1e7 --- /dev/null +++ b/Listings/Chapter4/4-2/main.master @@ -0,0 +1,17 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + +
+ + diff --git a/Listings/Chapter4/4-2/print.master b/Listings/Chapter4/4-2/print.master new file mode 100644 index 0000000..8d89d66 --- /dev/null +++ b/Listings/Chapter4/4-2/print.master @@ -0,0 +1,19 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ This master can be used for printing.
+
+ + +
+ + diff --git a/Listings/Chapter4/4-3/ContentPage3.aspx b/Listings/Chapter4/4-3/ContentPage3.aspx new file mode 100644 index 0000000..d1229dd --- /dev/null +++ b/Listings/Chapter4/4-3/ContentPage3.aspx @@ -0,0 +1,7 @@ +<%@ page language="C#" master="~/MasterPage3.master" %> + + diff --git a/Listings/Chapter4/4-3/MasterPage3.master b/Listings/Chapter4/4-3/MasterPage3.master new file mode 100644 index 0000000..555d257 --- /dev/null +++ b/Listings/Chapter4/4-3/MasterPage3.master @@ -0,0 +1,20 @@ +<%@ master language="C#" %> + + + + + + <ASP:Literal id="LT_HtmlTitle" runat="server" /> + + +
+ + +
+ + diff --git a/Listings/Chapter4/4-3/Web.Config b/Listings/Chapter4/4-3/Web.Config new file mode 100644 index 0000000..93fe22d --- /dev/null +++ b/Listings/Chapter4/4-3/Web.Config @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + diff --git a/Listings/Chapter4/4-4/ContentPage4.aspx b/Listings/Chapter4/4-4/ContentPage4.aspx new file mode 100644 index 0000000..35f7444 --- /dev/null +++ b/Listings/Chapter4/4-4/ContentPage4.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/MasterPage4.master" %> + + diff --git a/Listings/Chapter4/4-4/MasterPage4.master b/Listings/Chapter4/4-4/MasterPage4.master new file mode 100644 index 0000000..555d257 --- /dev/null +++ b/Listings/Chapter4/4-4/MasterPage4.master @@ -0,0 +1,20 @@ +<%@ master language="C#" %> + + + + + + <ASP:Literal id="LT_HtmlTitle" runat="server" /> + + +
+ + +
+ + diff --git a/Listings/Chapter4/4-4/Web.Config b/Listings/Chapter4/4-4/Web.Config new file mode 100644 index 0000000..93fe22d --- /dev/null +++ b/Listings/Chapter4/4-4/Web.Config @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + diff --git a/Listings/Chapter4/4-5/ContentPage5.aspx b/Listings/Chapter4/4-5/ContentPage5.aspx new file mode 100644 index 0000000..2fb760b --- /dev/null +++ b/Listings/Chapter4/4-5/ContentPage5.aspx @@ -0,0 +1,11 @@ +<%@ page language="C#" master="~/MasterPage5.master" %> + + + +
+
+ + + diff --git a/Listings/Chapter4/4-5/MasterMasterPage5.master b/Listings/Chapter4/4-5/MasterMasterPage5.master new file mode 100644 index 0000000..f5891b3 --- /dev/null +++ b/Listings/Chapter4/4-5/MasterMasterPage5.master @@ -0,0 +1,12 @@ +<%@ Master Language="C#" %> + + +
+

Parent Master

+

+ This is Parent-master content. +

+ + + + diff --git a/Listings/Chapter4/4-5/MasterPage5.master b/Listings/Chapter4/4-5/MasterPage5.master new file mode 100644 index 0000000..8fda287 --- /dev/null +++ b/Listings/Chapter4/4-5/MasterPage5.master @@ -0,0 +1,15 @@ +<%@ master language="C#" master="~/MasterMasterPage5.master" %> + + + +

Child master

+ +

This is childmaster content.

+ +
+ +

This is childmaster content.

+ +
+
+
diff --git a/Listings/Chapter4/4-5/Web.Config b/Listings/Chapter4/4-5/Web.Config new file mode 100644 index 0000000..93fe22d --- /dev/null +++ b/Listings/Chapter4/4-5/Web.Config @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + diff --git a/Listings/Chapter4/4-6/UCMaster.ascx b/Listings/Chapter4/4-6/UCMaster.ascx new file mode 100644 index 0000000..dc5d032 --- /dev/null +++ b/Listings/Chapter4/4-6/UCMaster.ascx @@ -0,0 +1,9 @@ +<%@ control language="C#" classname="UCMaster" master="~/UCMaster.master" %> + + + + This is my User Control + + This is my User Control, too diff --git a/Listings/Chapter4/4-6/UCMaster.aspx b/Listings/Chapter4/4-6/UCMaster.aspx new file mode 100644 index 0000000..3cd48ab --- /dev/null +++ b/Listings/Chapter4/4-6/UCMaster.aspx @@ -0,0 +1,19 @@ +<%@ page language="C#" %> +<%@ register tagprefix="uc1" tagname="UCMaster" src="~/UCMaster.ascx" %> + + + + + + Untitled Page + + +
+

This text is embedded in the page itself.

+ +

This text is again embedded in the page.

+
+ + diff --git a/Listings/Chapter4/4-6/UCMaster.master b/Listings/Chapter4/4-6/UCMaster.master new file mode 100644 index 0000000..95fccdf --- /dev/null +++ b/Listings/Chapter4/4-6/UCMaster.master @@ -0,0 +1,36 @@ +<%@ master language="C#" %> + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ This is my Master Page! +
+ + + + +
diff --git a/Listings/Chapter5/Navigation1.aspx b/Listings/Chapter5/Navigation1.aspx new file mode 100644 index 0000000..e74a1c1 --- /dev/null +++ b/Listings/Chapter5/Navigation1.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/Navigation1.master" %> + + + + + This is my content page. + diff --git a/Listings/Chapter5/Navigation1.master b/Listings/Chapter5/Navigation1.master new file mode 100644 index 0000000..87295f0 --- /dev/null +++ b/Listings/Chapter5/Navigation1.master @@ -0,0 +1,67 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + diff --git a/Listings/Chapter5/Navigation2.aspx b/Listings/Chapter5/Navigation2.aspx new file mode 100644 index 0000000..545dbf0 --- /dev/null +++ b/Listings/Chapter5/Navigation2.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/Navigation2.master" %> + + + + + This is my content page. + diff --git a/Listings/Chapter5/Navigation2.master b/Listings/Chapter5/Navigation2.master new file mode 100644 index 0000000..df0b51c --- /dev/null +++ b/Listings/Chapter5/Navigation2.master @@ -0,0 +1,67 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + diff --git a/Listings/Chapter5/Navigation3.aspx b/Listings/Chapter5/Navigation3.aspx new file mode 100644 index 0000000..4e057a6 --- /dev/null +++ b/Listings/Chapter5/Navigation3.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/Navigation3.master" %> + + + + + This is my content page. + diff --git a/Listings/Chapter5/Navigation3.master b/Listings/Chapter5/Navigation3.master new file mode 100644 index 0000000..a486493 --- /dev/null +++ b/Listings/Chapter5/Navigation3.master @@ -0,0 +1,71 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ You are here: + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + diff --git a/Listings/Chapter5/Navigation4.aspx b/Listings/Chapter5/Navigation4.aspx new file mode 100644 index 0000000..e044801 --- /dev/null +++ b/Listings/Chapter5/Navigation4.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/Navigation4.master" %> + + + + + This is my content page. + diff --git a/Listings/Chapter5/Navigation4.master b/Listings/Chapter5/Navigation4.master new file mode 100644 index 0000000..628f996 --- /dev/null +++ b/Listings/Chapter5/Navigation4.master @@ -0,0 +1,79 @@ +<%@ master language="C#" %> + + + + + + <ASP:Literal id="LT_HtmlTitle" runat="server"/> + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ You are here: + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + diff --git a/Listings/Chapter5/Navigation5.aspx b/Listings/Chapter5/Navigation5.aspx new file mode 100644 index 0000000..b495ef7 --- /dev/null +++ b/Listings/Chapter5/Navigation5.aspx @@ -0,0 +1,9 @@ +<%@ page language="C#" master="~/Navigation5.master" %> + + + + + This is my content page. + diff --git a/Listings/Chapter5/Navigation5.master b/Listings/Chapter5/Navigation5.master new file mode 100644 index 0000000..e494096 --- /dev/null +++ b/Listings/Chapter5/Navigation5.master @@ -0,0 +1,84 @@ +<%@ master language="C#" %> + + + + + + <ASP:Literal id="LT_HtmlTitle" runat="server"/> + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ You are here: + + +
+ + + + + + + + + + + + + + + + + + + +
+ +
+
+ + diff --git a/Listings/Chapter5/Web.Config b/Listings/Chapter5/Web.Config new file mode 100644 index 0000000..93fe22d --- /dev/null +++ b/Listings/Chapter5/Web.Config @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + diff --git a/Listings/Chapter5/app.sitemap b/Listings/Chapter5/app.sitemap new file mode 100644 index 0000000..f853787 --- /dev/null +++ b/Listings/Chapter5/app.sitemap @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + diff --git a/Listings/Chapter6/AdminArea/Default.aspx b/Listings/Chapter6/AdminArea/Default.aspx new file mode 100644 index 0000000..326bbe0 --- /dev/null +++ b/Listings/Chapter6/AdminArea/Default.aspx @@ -0,0 +1,6 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + User List +
+ Role List +
diff --git a/Listings/Chapter6/AdminArea/RoleList.aspx b/Listings/Chapter6/AdminArea/RoleList.aspx new file mode 100644 index 0000000..74e008f --- /dev/null +++ b/Listings/Chapter6/AdminArea/RoleList.aspx @@ -0,0 +1,86 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + Available Roles:   + + +
+
+ + +  
+
+ Role Members:
+ + +
+
+ + +
diff --git a/Listings/Chapter6/AdminArea/UserList.aspx b/Listings/Chapter6/AdminArea/UserList.aspx new file mode 100644 index 0000000..933a5a8 --- /dev/null +++ b/Listings/Chapter6/AdminArea/UserList.aspx @@ -0,0 +1,61 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
diff --git a/Listings/Chapter6/AdminArea/web.config b/Listings/Chapter6/AdminArea/web.config new file mode 100644 index 0000000..7565c2f --- /dev/null +++ b/Listings/Chapter6/AdminArea/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter6/Data/AspNetDB.mdb b/Listings/Chapter6/Data/AspNetDB.mdb new file mode 100644 index 0000000..89a5e63 Binary files /dev/null and b/Listings/Chapter6/Data/AspNetDB.mdb differ diff --git a/Listings/Chapter6/Default.aspx b/Listings/Chapter6/Default.aspx new file mode 100644 index 0000000..d1a2276 --- /dev/null +++ b/Listings/Chapter6/Default.aspx @@ -0,0 +1,15 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + +

Main page - open for any (anonymous) user

+

+ Label +

+
diff --git a/Listings/Chapter6/Global.asax b/Listings/Chapter6/Global.asax new file mode 100644 index 0000000..e526a2f --- /dev/null +++ b/Listings/Chapter6/Global.asax @@ -0,0 +1,15 @@ +<%@ application language="C#" %> + + diff --git a/Listings/Chapter6/Login.aspx b/Listings/Chapter6/Login.aspx new file mode 100644 index 0000000..8638f53 --- /dev/null +++ b/Listings/Chapter6/Login.aspx @@ -0,0 +1,68 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Log In
Please enter your user name and password to log in
User Name: + + + * +
Password: + + + * +
+ +
+ +
+ + +
+
+
+
+ + + + + +
+
diff --git a/Listings/Chapter6/MasterPage.master b/Listings/Chapter6/MasterPage.master new file mode 100644 index 0000000..ac4f72d --- /dev/null +++ b/Listings/Chapter6/MasterPage.master @@ -0,0 +1,72 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+ +

+ + + + +

+
+ + + Links:
+ Main +
+ Register User +
+ + + + Links:
Main
Protected Area
+ Admin Area +
+
+
+ + Links:
+ Main
+ Protected Area +
+
+
+ + +
+ Active User Count: + +
+
+ + diff --git a/Listings/Chapter6/PasswordRecovery.txt b/Listings/Chapter6/PasswordRecovery.txt new file mode 100644 index 0000000..143079c --- /dev/null +++ b/Listings/Chapter6/PasswordRecovery.txt @@ -0,0 +1,6 @@ +Hi there! + +Your user name is <%UserName%>. +Your password is <%Password%>. + +Thanks! \ No newline at end of file diff --git a/Listings/Chapter6/ProtectedArea/Default.aspx b/Listings/Chapter6/ProtectedArea/Default.aspx new file mode 100644 index 0000000..6f112c9 --- /dev/null +++ b/Listings/Chapter6/ProtectedArea/Default.aspx @@ -0,0 +1,5 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + Update + User Data + diff --git a/Listings/Chapter6/ProtectedArea/UpdateUserData.aspx b/Listings/Chapter6/ProtectedArea/UpdateUserData.aspx new file mode 100644 index 0000000..4b984cf --- /dev/null +++ b/Listings/Chapter6/ProtectedArea/UpdateUserData.aspx @@ -0,0 +1,113 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
E-Mail: + + + + * +
Comment: + + +  
Old Password: + + + +
New Password: + + + +
Passwort Confirmation: + + + + * +
+ + +
+ + + +
+
diff --git a/Listings/Chapter6/ProtectedArea/web.config b/Listings/Chapter6/ProtectedArea/web.config new file mode 100644 index 0000000..ab88b0a --- /dev/null +++ b/Listings/Chapter6/ProtectedArea/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter6/Register.aspx b/Listings/Chapter6/Register.aspx new file mode 100644 index 0000000..b5aecd6 --- /dev/null +++ b/Listings/Chapter6/Register.aspx @@ -0,0 +1,105 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: + + + + + * +
E-Mail: + + + + + * +
Password: + + + + * +
Password Confirmation: + + + + * + * +
+ + +
+ + + + +
+
diff --git a/Listings/Chapter6/web.config b/Listings/Chapter6/web.config new file mode 100644 index 0000000..654375f --- /dev/null +++ b/Listings/Chapter6/web.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter7/AdminArea/Default.aspx b/Listings/Chapter7/AdminArea/Default.aspx new file mode 100644 index 0000000..1f66b9f --- /dev/null +++ b/Listings/Chapter7/AdminArea/Default.aspx @@ -0,0 +1,10 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + User List +
+ Role List +
diff --git a/Listings/Chapter7/AdminArea/RoleList.aspx b/Listings/Chapter7/AdminArea/RoleList.aspx new file mode 100644 index 0000000..74e008f --- /dev/null +++ b/Listings/Chapter7/AdminArea/RoleList.aspx @@ -0,0 +1,86 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + Available Roles:   + + +
+
+ + +  
+
+ Role Members:
+ + +
+
+ + +
diff --git a/Listings/Chapter7/AdminArea/UserList.aspx b/Listings/Chapter7/AdminArea/UserList.aspx new file mode 100644 index 0000000..2499a5d --- /dev/null +++ b/Listings/Chapter7/AdminArea/UserList.aspx @@ -0,0 +1,62 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
diff --git a/Listings/Chapter7/AdminArea/web.config b/Listings/Chapter7/AdminArea/web.config new file mode 100644 index 0000000..7565c2f --- /dev/null +++ b/Listings/Chapter7/AdminArea/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter7/Basket.aspx b/Listings/Chapter7/Basket.aspx new file mode 100644 index 0000000..387e4c7 --- /dev/null +++ b/Listings/Chapter7/Basket.aspx @@ -0,0 +1,101 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter7/Code/Basket.cs b/Listings/Chapter7/Code/Basket.cs new file mode 100644 index 0000000..1cfaea7 --- /dev/null +++ b/Listings/Chapter7/Code/Basket.cs @@ -0,0 +1,22 @@ +using System; + +[Serializable] +public class Basket : System.Collections.Generic.List { + + public void Remove(int productId) { + BasketItem item = this.FindItemByProductId(productId); + if (item != null) { + base.Remove(item); + } + } + + + public BasketItem FindItemByProductId(int productId) { + foreach (BasketItem item in this) { + if (item.ProductId.Equals(productId)) { + return item; + } + } + return null; + } +} diff --git a/Listings/Chapter7/Code/BasketItem.cs b/Listings/Chapter7/Code/BasketItem.cs new file mode 100644 index 0000000..4a85a06 --- /dev/null +++ b/Listings/Chapter7/Code/BasketItem.cs @@ -0,0 +1,39 @@ +using System; + +[Serializable] +public class BasketItem { + + private int productId; + private string name; + private int count; + private decimal unitPrice; + + public BasketItem() {} + + public BasketItem(int productId, string name, int count, decimal unitPrice) { + this.productId = productId; + this.name = name; + this.count = count; + this.unitPrice = unitPrice; + } + + public int ProductId { + get { return this.productId; } + set { this.productId = value; } + } + + public string Name { + get { return this.name; } + set { this.name = value; } + } + + public int Count { + get { return this.count; } + set { this.count = value; } + } + + public decimal UnitPrice { + get { return this.unitPrice; } + set { this.unitPrice = value; } + } +} diff --git a/Listings/Chapter7/Code/BasketManager.cs b/Listings/Chapter7/Code/BasketManager.cs new file mode 100644 index 0000000..535b9e9 --- /dev/null +++ b/Listings/Chapter7/Code/BasketManager.cs @@ -0,0 +1,32 @@ +using System; +using System.Web; +using System.Web.Personalization; + +public class BasketManager { + + public Basket GetBasket() { + HttpPersonalizationBaseClass profile = HttpContext.Current.Profile; + return (profile.GetPropertyValue("Basket") as Basket); + } + + public void Delete(int ProductId) { + Basket basket = this.GetBasket(); + basket.Remove(ProductId); + } + + public void Update(int ProductId, string Name, int Count, decimal UnitPrice) { + Basket basket = this.GetBasket(); + BasketItem item = basket.FindItemByProductId(ProductId); + + if (item != null) { + item.Name = Name; + item.Count = Count; + item.UnitPrice = UnitPrice; + } + } + + public void Insert(int ProductId, string Name, int Count, decimal UnitPrice) { + Basket basket = this.GetBasket(); + basket.Add(new BasketItem(ProductId, Name, Count, UnitPrice)); + } +} diff --git a/Listings/Chapter7/Data/AspNetDB.mdb b/Listings/Chapter7/Data/AspNetDB.mdb new file mode 100644 index 0000000..11716f0 Binary files /dev/null and b/Listings/Chapter7/Data/AspNetDB.mdb differ diff --git a/Listings/Chapter7/Default.aspx b/Listings/Chapter7/Default.aspx new file mode 100644 index 0000000..d61ec95 --- /dev/null +++ b/Listings/Chapter7/Default.aspx @@ -0,0 +1,14 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + +

Main page - open for any (anonymous) user

+

+ Label  +

+
diff --git a/Listings/Chapter7/Global.asax b/Listings/Chapter7/Global.asax new file mode 100644 index 0000000..fbd50d4 --- /dev/null +++ b/Listings/Chapter7/Global.asax @@ -0,0 +1,19 @@ +<%@ application language="C#" %> + + diff --git a/Listings/Chapter7/Login.aspx b/Listings/Chapter7/Login.aspx new file mode 100644 index 0000000..8638f53 --- /dev/null +++ b/Listings/Chapter7/Login.aspx @@ -0,0 +1,68 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Log In
Please enter your user name and password to log in
User Name: + + + * +
Password: + + + * +
+ +
+ +
+ + +
+
+
+
+ + + + + +
+
diff --git a/Listings/Chapter7/MasterPage.master b/Listings/Chapter7/MasterPage.master new file mode 100644 index 0000000..210744d --- /dev/null +++ b/Listings/Chapter7/MasterPage.master @@ -0,0 +1,86 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + +
+ +

+ + + + +

+
+ + + Links:
+ Main +
+ Register User +
+ + + + Links:
Main
Protected Area
+ Admin Area +
+
+
+ + Links:
+ Main
+ Protected Area +
+
+
+ + +
+ Active User Count: + +
+ Bookmark + page + | + + Show bookmarks +
+
+ + diff --git a/Listings/Chapter7/PasswordRecovery.txt b/Listings/Chapter7/PasswordRecovery.txt new file mode 100644 index 0000000..143079c --- /dev/null +++ b/Listings/Chapter7/PasswordRecovery.txt @@ -0,0 +1,6 @@ +Hi there! + +Your user name is <%UserName%>. +Your password is <%Password%>. + +Thanks! \ No newline at end of file diff --git a/Listings/Chapter7/ProtectedArea/Basket.aspx b/Listings/Chapter7/ProtectedArea/Basket.aspx new file mode 100644 index 0000000..387e4c7 --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/Basket.aspx @@ -0,0 +1,101 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter7/ProtectedArea/Default.aspx b/Listings/Chapter7/ProtectedArea/Default.aspx new file mode 100644 index 0000000..fa21643 --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/Default.aspx @@ -0,0 +1,32 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + Update User Data +
+ Edit Profile +
+ Edit Bookmarks +
+ Basket +
+
+ Your nickname: + + +
diff --git a/Listings/Chapter7/ProtectedArea/EditBookmarks.aspx b/Listings/Chapter7/ProtectedArea/EditBookmarks.aspx new file mode 100644 index 0000000..dbb41df --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/EditBookmarks.aspx @@ -0,0 +1,40 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + +
+ + +
+ diff --git a/Listings/Chapter7/ProtectedArea/EditProfile.aspx b/Listings/Chapter7/ProtectedArea/EditProfile.aspx new file mode 100644 index 0000000..be8bed1 --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/EditProfile.aspx @@ -0,0 +1,87 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
Nickname: + + +  
Birthday: + + +  * +
Years Experience with ASP.NET: + + + + * +
 
+ + + +
+
diff --git a/Listings/Chapter7/ProtectedArea/UpdateUserData.aspx b/Listings/Chapter7/ProtectedArea/UpdateUserData.aspx new file mode 100644 index 0000000..4b984cf --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/UpdateUserData.aspx @@ -0,0 +1,113 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
E-Mail: + + + + * +
Comment: + + +  
Old Password: + + + +
New Password: + + + +
Passwort Confirmation: + + + + * +
+ + +
+ + + +
+
diff --git a/Listings/Chapter7/ProtectedArea/web.config b/Listings/Chapter7/ProtectedArea/web.config new file mode 100644 index 0000000..ab88b0a --- /dev/null +++ b/Listings/Chapter7/ProtectedArea/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter7/Register.aspx b/Listings/Chapter7/Register.aspx new file mode 100644 index 0000000..b5aecd6 --- /dev/null +++ b/Listings/Chapter7/Register.aspx @@ -0,0 +1,105 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: + + + + + * +
E-Mail: + + + + + * +
Password: + + + + * +
Password Confirmation: + + + + * + * +
+ + +
+ + + + +
+
diff --git a/Listings/Chapter7/web.config b/Listings/Chapter7/web.config new file mode 100644 index 0000000..21d5399 --- /dev/null +++ b/Listings/Chapter7/web.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter8/AdminArea/Default.aspx b/Listings/Chapter8/AdminArea/Default.aspx new file mode 100644 index 0000000..1f66b9f --- /dev/null +++ b/Listings/Chapter8/AdminArea/Default.aspx @@ -0,0 +1,10 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + User List +
+ Role List +
diff --git a/Listings/Chapter8/AdminArea/RoleList.aspx b/Listings/Chapter8/AdminArea/RoleList.aspx new file mode 100644 index 0000000..74e008f --- /dev/null +++ b/Listings/Chapter8/AdminArea/RoleList.aspx @@ -0,0 +1,86 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + Available Roles:   + + +
+
+ + +  
+
+ Role Members:
+ + +
+
+ + +
diff --git a/Listings/Chapter8/AdminArea/UserList.aspx b/Listings/Chapter8/AdminArea/UserList.aspx new file mode 100644 index 0000000..2499a5d --- /dev/null +++ b/Listings/Chapter8/AdminArea/UserList.aspx @@ -0,0 +1,62 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
diff --git a/Listings/Chapter8/AdminArea/web.config b/Listings/Chapter8/AdminArea/web.config new file mode 100644 index 0000000..7565c2f --- /dev/null +++ b/Listings/Chapter8/AdminArea/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter8/Catalog.ascx b/Listings/Chapter8/Catalog.ascx new file mode 100644 index 0000000..8bd1986 --- /dev/null +++ b/Listings/Chapter8/Catalog.ascx @@ -0,0 +1,42 @@ +<%@ control language="C#" classname="Catalog"%> + + + + + + + + + + + + + + + + DOW + + + + + + S&P + + + + + + NASDAQ + + + + + + + diff --git a/Listings/Chapter8/Code/WeatherWebPart.cs b/Listings/Chapter8/Code/WeatherWebPart.cs new file mode 100644 index 0000000..d86c59a --- /dev/null +++ b/Listings/Chapter8/Code/WeatherWebPart.cs @@ -0,0 +1,65 @@ +using System; +using System.ComponentModel; +using System.Web.Personalization; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace PGK.Web.UI.WebControls.WebParts { + + public sealed class WeatherWebPart: WebPart { + + private const string HtmlFormat = @" +
+ + + "; + + private string _zipCode = String.Empty; + + [Personalizable] + [WebBrowsable] + [System.ComponentModel.DisplayName("Your ZIP Code")] + public string ZipCode { + get { + return _zipCode; + } + set { + _zipCode = value; + } + } + + protected override void RenderContents(HtmlTextWriter writer) { + string text; + + if ((_zipCode == null) || (_zipCode.Length == 0)) { + writer.Write("Please enter a zip code by personalizing this WebPart!"); + } else { + writer.Write(String.Format(HtmlFormat, _zipCode)); + } + } + } +} \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/AdminArea/Default.aspx b/Listings/Chapter8/ConnectionPoints/AdminArea/Default.aspx new file mode 100644 index 0000000..1f66b9f --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/AdminArea/Default.aspx @@ -0,0 +1,10 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + User List +
+ Role List +
diff --git a/Listings/Chapter8/ConnectionPoints/AdminArea/RoleList.aspx b/Listings/Chapter8/ConnectionPoints/AdminArea/RoleList.aspx new file mode 100644 index 0000000..74e008f --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/AdminArea/RoleList.aspx @@ -0,0 +1,86 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + Available Roles:   + + +
+
+ + +  
+
+ Role Members:
+ + +
+
+ + +
diff --git a/Listings/Chapter8/ConnectionPoints/AdminArea/UserList.aspx b/Listings/Chapter8/ConnectionPoints/AdminArea/UserList.aspx new file mode 100644 index 0000000..2499a5d --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/AdminArea/UserList.aspx @@ -0,0 +1,62 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + +
diff --git a/Listings/Chapter8/ConnectionPoints/AdminArea/web.config b/Listings/Chapter8/ConnectionPoints/AdminArea/web.config new file mode 100644 index 0000000..7565c2f --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/AdminArea/web.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/Catalog.ascx b/Listings/Chapter8/ConnectionPoints/Catalog.ascx new file mode 100644 index 0000000..8bd1986 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Catalog.ascx @@ -0,0 +1,42 @@ +<%@ control language="C#" classname="Catalog"%> + + + + + + + + + + + + + + + + DOW + + + + + + S&P + + + + + + NASDAQ + + + + + + + diff --git a/Listings/Chapter8/ConnectionPoints/Code/IZipProvider.cs b/Listings/Chapter8/ConnectionPoints/Code/IZipProvider.cs new file mode 100644 index 0000000..82b70a4 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Code/IZipProvider.cs @@ -0,0 +1,10 @@ +using System; + +public interface IZipProvider { + + event EventHandler ZipHasChanged; + + string Zip { + get; + } +} diff --git a/Listings/Chapter8/ConnectionPoints/Code/WeatherWebPart.cs b/Listings/Chapter8/ConnectionPoints/Code/WeatherWebPart.cs new file mode 100644 index 0000000..870ca2f --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Code/WeatherWebPart.cs @@ -0,0 +1,99 @@ +using System; +using System.ComponentModel; +using System.Web.Personalization; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace PGK.Web.UI.WebControls.WebParts { + + public sealed class WeatherWebPart: WebPart { + + private ConnectionPointCollection connectionPoints; + private IZipProvider zipProvider; + + public override ConnectionPointCollection ConnectionPoints { + get { + if (this.connectionPoints == null) { + this.connectionPoints = new ConnectionPointCollection(this, base.ConnectionPoints); + + ConnectionConsumerCallback consCallBack = new ConnectionConsumerCallback(ConnectToProvider); + ConnectionPoint connPoint = new ConnectionPoint(typeof(IZipProvider), consCallBack); + + connPoint.Name = "ZipConsumerPoint"; + this.connectionPoints.Add(connPoint); + } + + return this.connectionPoints; + } + } + + public void ConnectToProvider(object obj) { + if (obj == null && this.zipProvider == null) + throw new Exception("Null interface"); + + this.zipProvider = (IZipProvider) obj; + if (this.zipProvider != null) { + this.ZipCode = this.zipProvider.Zip; + this.zipProvider.ZipHasChanged += new EventHandler(OnProviderZipChanged); + } + } + + public void OnProviderZipChanged(object sender, EventArgs e) { + this.ZipCode = this.zipProvider.Zip; + } + + private const string HtmlFormat = @" +
+ + + "; + + private string _zipCode = String.Empty; + + [Personalizable] + [WebBrowsable] + [System.ComponentModel.DisplayName("Your ZIP Code")] + public string ZipCode { + get { + return _zipCode; + } + set { + _zipCode = value; + } + } + + protected override void RenderContents(HtmlTextWriter writer) { + string text; + + if ((_zipCode == null) || (_zipCode.Length == 0)) { + writer.Write("Please enter a zip code by personalizing this WebPart!"); + } else { + writer.Write(String.Format(HtmlFormat, _zipCode)); + } + } + } +} \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/Code/ZipProviderWebPart.cs b/Listings/Chapter8/ConnectionPoints/Code/ZipProviderWebPart.cs new file mode 100644 index 0000000..33aca7c --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Code/ZipProviderWebPart.cs @@ -0,0 +1,65 @@ +using System; +using System.ComponentModel; +using System.Web.Personalization; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace PGK.Web.UI.WebControls.WebParts { + + public class ZipProviderWebPart: WebPart, IZipProvider, INamingContainer { + + private string zip = string.Empty; + private ConnectionPointCollection connectionPoints; + private EventHandler zipHasChanged; + private Button button; + private TextBox textBox; + + public ZipProviderWebPart() { } + + string IZipProvider.Zip { + get { return this.zip; } + } + + event EventHandler IZipProvider.ZipHasChanged { + add { this.zipHasChanged += value; } + remove { this.zipHasChanged -= value; } + } + + protected override void CreateChildControls() { + this.textBox = new TextBox(); + this.textBox.AutoPostBack = true; + this.textBox.Text = "90211"; + this.textBox.TextChanged += new EventHandler(this.OnZipChanged); + this.Controls.Add(this.textBox); + this.button = new Button(); + this.button.Text = "Submit"; + this.Controls.Add(this.button); + } + + protected void OnZipChanged(object sender, EventArgs e) { + this.zip = this.textBox.Text; + if (this.zipHasChanged != null) { + this.zipHasChanged(this, e); + } + } + + public override ConnectionPointCollection ConnectionPoints { + get { + if (this.connectionPoints == null) { + this.connectionPoints = new ConnectionPointCollection(this, base.ConnectionPoints); + + ConnectionProviderCallback provCallBack = new ConnectionProviderCallback(GetIZipProvider); + + ConnectionPoint connPoint = new ConnectionPoint(typeof(IZipProvider), provCallBack); + connPoint.Name = "ZipProviderPoint"; + this.connectionPoints.Add(connPoint); + } + return this.connectionPoints; + } + } + + private object GetIZipProvider() { + return (IZipProvider)this; + } + } +} \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/DailyLinksWebPart.ascx b/Listings/Chapter8/ConnectionPoints/DailyLinksWebPart.ascx new file mode 100644 index 0000000..031093b --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/DailyLinksWebPart.ascx @@ -0,0 +1,22 @@ +<%@ control language="C#" classname="DailyLinks"%> + + + + + + + + + +
+   + + + + + + +
diff --git a/Listings/Chapter8/ConnectionPoints/Data/AspNetDB.mdb b/Listings/Chapter8/ConnectionPoints/Data/AspNetDB.mdb new file mode 100644 index 0000000..e82ea75 Binary files /dev/null and b/Listings/Chapter8/ConnectionPoints/Data/AspNetDB.mdb differ diff --git a/Listings/Chapter8/ConnectionPoints/Data/DailyLinks.xml b/Listings/Chapter8/ConnectionPoints/Data/DailyLinks.xml new file mode 100644 index 0000000..a3691a9 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Data/DailyLinks.xml @@ -0,0 +1,28 @@ + + + + 0 + ASP.NET + http://www.asp.net + + + 1 + MSDN + http://msdn.microsoft.com + + + 2 + MSN + http://www.msn.com + + + 3 + MSNBC + http://www.msnbc.com + + + 4 + Google + http://www.google.com + + diff --git a/Listings/Chapter8/ConnectionPoints/Default.aspx b/Listings/Chapter8/ConnectionPoints/Default.aspx new file mode 100644 index 0000000..b4f8fe2 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Default.aspx @@ -0,0 +1,151 @@ +<%@ page language="C#" master="~/MasterPage.master" %> +<%@ register tagprefix="uc1" tagname="Catalog" src="~/Catalog.ascx" %> +<%@ register tagprefix="uc1" tagname="DailyLinksWebPart" src="~/DailyLinksWebPart.ascx" %> +<%@ register tagprefix="WebParts" namespace="PGK.Web.UI.WebControls.WebParts" %> + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + Welcome!
+
+ Welcome to my small test application! This is a simple page using three different + zones including some web parts. Nice feature, right? +
+
+
+
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Personalize + this page! + Add + web parts + + + +
+
diff --git a/Listings/Chapter8/ConnectionPoints/Login.aspx b/Listings/Chapter8/ConnectionPoints/Login.aspx new file mode 100644 index 0000000..8638f53 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Login.aspx @@ -0,0 +1,68 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Log In
Please enter your user name and password to log in
User Name: + + + * +
Password: + + + * +
+ +
+ +
+ + +
+
+
+
+ + + + + +
+
diff --git a/Listings/Chapter8/ConnectionPoints/MasterPage.master b/Listings/Chapter8/ConnectionPoints/MasterPage.master new file mode 100644 index 0000000..8cadfa1 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/MasterPage.master @@ -0,0 +1,57 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + +
+ +

+ + + + +

+
+ + + Links:
+ Main +
+ Register User +
+ + + + Links:
Main
Protected Area
+ Admin Area +
+
+
+ + Links:
+ Main
+ Protected Area +
+
+
+ + +
+
+ + diff --git a/Listings/Chapter8/ConnectionPoints/PasswordRecovery.txt b/Listings/Chapter8/ConnectionPoints/PasswordRecovery.txt new file mode 100644 index 0000000..143079c --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/PasswordRecovery.txt @@ -0,0 +1,6 @@ +Hi there! + +Your user name is <%UserName%>. +Your password is <%Password%>. + +Thanks! \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/ProtectedArea/Default.aspx b/Listings/Chapter8/ConnectionPoints/ProtectedArea/Default.aspx new file mode 100644 index 0000000..fa21643 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/ProtectedArea/Default.aspx @@ -0,0 +1,32 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + Update User Data +
+ Edit Profile +
+ Edit Bookmarks +
+ Basket +
+
+ Your nickname: + + +
diff --git a/Listings/Chapter8/ConnectionPoints/ProtectedArea/EditProfile.aspx b/Listings/Chapter8/ConnectionPoints/ProtectedArea/EditProfile.aspx new file mode 100644 index 0000000..be8bed1 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/ProtectedArea/EditProfile.aspx @@ -0,0 +1,87 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
Nickname: + + +  
Birthday: + + +  * +
Years Experience with ASP.NET: + + + + * +
 
+ + + +
+
diff --git a/Listings/Chapter8/ConnectionPoints/ProtectedArea/UpdateUserData.aspx b/Listings/Chapter8/ConnectionPoints/ProtectedArea/UpdateUserData.aspx new file mode 100644 index 0000000..4b984cf --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/ProtectedArea/UpdateUserData.aspx @@ -0,0 +1,113 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
E-Mail: + + + + * +
Comment: + + +  
Old Password: + + + +
New Password: + + + +
Passwort Confirmation: + + + + * +
+ + +
+ + + +
+
diff --git a/Listings/Chapter8/ConnectionPoints/ProtectedArea/web.config b/Listings/Chapter8/ConnectionPoints/ProtectedArea/web.config new file mode 100644 index 0000000..ab88b0a --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/ProtectedArea/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter8/ConnectionPoints/Register.aspx b/Listings/Chapter8/ConnectionPoints/Register.aspx new file mode 100644 index 0000000..b5aecd6 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/Register.aspx @@ -0,0 +1,105 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: + + + + + * +
E-Mail: + + + + + * +
Password: + + + + * +
Password Confirmation: + + + + * + * +
+ + +
+ + + + +
+
diff --git a/Listings/Chapter8/ConnectionPoints/web.config b/Listings/Chapter8/ConnectionPoints/web.config new file mode 100644 index 0000000..6d09893 --- /dev/null +++ b/Listings/Chapter8/ConnectionPoints/web.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter8/DailyLinksWebPart.ascx b/Listings/Chapter8/DailyLinksWebPart.ascx new file mode 100644 index 0000000..031093b --- /dev/null +++ b/Listings/Chapter8/DailyLinksWebPart.ascx @@ -0,0 +1,22 @@ +<%@ control language="C#" classname="DailyLinks"%> + + + + + + + + + +
+   + + + + + + +
diff --git a/Listings/Chapter8/Data/AspNetDB.mdb b/Listings/Chapter8/Data/AspNetDB.mdb new file mode 100644 index 0000000..a45b214 Binary files /dev/null and b/Listings/Chapter8/Data/AspNetDB.mdb differ diff --git a/Listings/Chapter8/Data/DailyLinks.xml b/Listings/Chapter8/Data/DailyLinks.xml new file mode 100644 index 0000000..a3691a9 --- /dev/null +++ b/Listings/Chapter8/Data/DailyLinks.xml @@ -0,0 +1,28 @@ + + + + 0 + ASP.NET + http://www.asp.net + + + 1 + MSDN + http://msdn.microsoft.com + + + 2 + MSN + http://www.msn.com + + + 3 + MSNBC + http://www.msnbc.com + + + 4 + Google + http://www.google.com + + diff --git a/Listings/Chapter8/Default.aspx b/Listings/Chapter8/Default.aspx new file mode 100644 index 0000000..ae7423b --- /dev/null +++ b/Listings/Chapter8/Default.aspx @@ -0,0 +1,143 @@ +<%@ page language="C#" master="~/MasterPage.master" %> +<%@ register tagprefix="uc1" tagname="Catalog" src="~/Catalog.ascx" %> +<%@ register tagprefix="uc1" tagname="DailyLinksWebPart" src="~/DailyLinksWebPart.ascx" %> +<%@ register tagprefix="WebParts" namespace="PGK.Web.UI.WebControls.WebParts" %> + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + Welcome!
+
+ Welcome to my small test application! This is a simple page using three different + zones including some web parts. Nice feature, right? +
+
+
+
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ Personalize + this page! + Add + web parts + + + +
+
diff --git a/Listings/Chapter8/Login.aspx b/Listings/Chapter8/Login.aspx new file mode 100644 index 0000000..8638f53 --- /dev/null +++ b/Listings/Chapter8/Login.aspx @@ -0,0 +1,68 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Log In
Please enter your user name and password to log in
User Name: + + + * +
Password: + + + * +
+ +
+ +
+ + +
+
+
+
+ + + + + +
+
diff --git a/Listings/Chapter8/MasterPage.master b/Listings/Chapter8/MasterPage.master new file mode 100644 index 0000000..6c970bf --- /dev/null +++ b/Listings/Chapter8/MasterPage.master @@ -0,0 +1,58 @@ +<%@ master language="C#" %> + + + + + + Untitled Page + + + +
+ + + + + + + + + +
+ +

+ + + + +

+
+ + + Links:
+ Main +
+ Register User +
+ + + + Links:
Main
Protected Area
+ Admin Area +
+
+
+ + Links:
+ Main
+ Protected Area +
+
+
+ + +
+
+ + diff --git a/Listings/Chapter8/PasswordRecovery.txt b/Listings/Chapter8/PasswordRecovery.txt new file mode 100644 index 0000000..143079c --- /dev/null +++ b/Listings/Chapter8/PasswordRecovery.txt @@ -0,0 +1,6 @@ +Hi there! + +Your user name is <%UserName%>. +Your password is <%Password%>. + +Thanks! \ No newline at end of file diff --git a/Listings/Chapter8/ProtectedArea/Default.aspx b/Listings/Chapter8/ProtectedArea/Default.aspx new file mode 100644 index 0000000..fa21643 --- /dev/null +++ b/Listings/Chapter8/ProtectedArea/Default.aspx @@ -0,0 +1,32 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + Update User Data +
+ Edit Profile +
+ Edit Bookmarks +
+ Basket +
+
+ Your nickname: + + +
diff --git a/Listings/Chapter8/ProtectedArea/EditProfile.aspx b/Listings/Chapter8/ProtectedArea/EditProfile.aspx new file mode 100644 index 0000000..be8bed1 --- /dev/null +++ b/Listings/Chapter8/ProtectedArea/EditProfile.aspx @@ -0,0 +1,87 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
Nickname: + + +  
Birthday: + + +  * +
Years Experience with ASP.NET: + + + + * +
 
+ + + +
+
diff --git a/Listings/Chapter8/ProtectedArea/UpdateUserData.aspx b/Listings/Chapter8/ProtectedArea/UpdateUserData.aspx new file mode 100644 index 0000000..4b984cf --- /dev/null +++ b/Listings/Chapter8/ProtectedArea/UpdateUserData.aspx @@ -0,0 +1,113 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: +   +  
E-Mail: + + + + * +
Comment: + + +  
Old Password: + + + +
New Password: + + + +
Passwort Confirmation: + + + + * +
+ + +
+ + + +
+
diff --git a/Listings/Chapter8/ProtectedArea/web.config b/Listings/Chapter8/ProtectedArea/web.config new file mode 100644 index 0000000..ab88b0a --- /dev/null +++ b/Listings/Chapter8/ProtectedArea/web.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter8/Register.aspx b/Listings/Chapter8/Register.aspx new file mode 100644 index 0000000..b5aecd6 --- /dev/null +++ b/Listings/Chapter8/Register.aspx @@ -0,0 +1,105 @@ +<%@ page language="C#" master="~/MasterPage.master" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
User Name: + + + + + * +
E-Mail: + + + + + * +
Password: + + + + * +
Password Confirmation: + + + + * + * +
+ + +
+ + + + +
+
diff --git a/Listings/Chapter8/web.config b/Listings/Chapter8/web.config new file mode 100644 index 0000000..6d09893 --- /dev/null +++ b/Listings/Chapter8/web.config @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Listings/Chapter9/GlobalThemes/SubFolder/Theme1.aspx b/Listings/Chapter9/GlobalThemes/SubFolder/Theme1.aspx new file mode 100644 index 0000000..143b739 --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/SubFolder/Theme1.aspx @@ -0,0 +1,93 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/GlobalThemes/Theme1.aspx b/Listings/Chapter9/GlobalThemes/Theme1.aspx new file mode 100644 index 0000000..143b739 --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/Theme1.aspx @@ -0,0 +1,93 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/GlobalThemes/Theme2.aspx b/Listings/Chapter9/GlobalThemes/Theme2.aspx new file mode 100644 index 0000000..eeb7852 --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/Theme2.aspx @@ -0,0 +1,89 @@ +<%@ page language="C#" theme="SmokeAndGlass" %> + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/GlobalThemes/Theme3.aspx b/Listings/Chapter9/GlobalThemes/Theme3.aspx new file mode 100644 index 0000000..d6b181d --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/Theme3.aspx @@ -0,0 +1,98 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/GlobalThemes/Web.config b/Listings/Chapter9/GlobalThemes/Web.config new file mode 100644 index 0000000..b284524 --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/Web.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/Listings/Chapter9/GlobalThemes/app.sitemap b/Listings/Chapter9/GlobalThemes/app.sitemap new file mode 100644 index 0000000..f853787 --- /dev/null +++ b/Listings/Chapter9/GlobalThemes/app.sitemap @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + diff --git a/Listings/Chapter9/NewTheme/Theme4.aspx b/Listings/Chapter9/NewTheme/Theme4.aspx new file mode 100644 index 0000000..1c0547f --- /dev/null +++ b/Listings/Chapter9/NewTheme/Theme4.aspx @@ -0,0 +1,92 @@ +<%@ page language="C#" %> + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/NewTheme/Theme5.aspx b/Listings/Chapter9/NewTheme/Theme5.aspx new file mode 100644 index 0000000..23e6f2a --- /dev/null +++ b/Listings/Chapter9/NewTheme/Theme5.aspx @@ -0,0 +1,77 @@ +<%@ page language="C#" %> + + + + + Untitled Page + + +
+ + + + + + +
+   + + + + + + + + + + + + + + + + + + + + + + +    + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + diff --git a/Listings/Chapter9/NewTheme/Theme6.aspx b/Listings/Chapter9/NewTheme/Theme6.aspx new file mode 100644 index 0000000..6e7fb00 --- /dev/null +++ b/Listings/Chapter9/NewTheme/Theme6.aspx @@ -0,0 +1,93 @@ +<%@ page language="C#" EnableTheming="false" %> + + + + + + Untitled Page + + +
+ + + + + + + + + + + + + + + +
+

My Little Company

+
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   +
+ +
+
+ + diff --git a/Listings/Chapter9/NewTheme/Web.config b/Listings/Chapter9/NewTheme/Web.config new file mode 100644 index 0000000..b5431a0 --- /dev/null +++ b/Listings/Chapter9/NewTheme/Web.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Listings/Chapter9/NewTheme/app.sitemap b/Listings/Chapter9/NewTheme/app.sitemap new file mode 100644 index 0000000..f853787 --- /dev/null +++ b/Listings/Chapter9/NewTheme/app.sitemap @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + diff --git a/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/styles.css b/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/styles.css new file mode 100644 index 0000000..7e153b1 --- /dev/null +++ b/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/styles.css @@ -0,0 +1,11 @@ +body,td +{ + font-family: Verdana; + font-size: 11px; +} + +h1 +{ + font-size: 30px; + color: blue; +} \ No newline at end of file diff --git a/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/theme.skin b/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/theme.skin new file mode 100644 index 0000000..f02d3cb --- /dev/null +++ b/Listings/Chapter9/NewTheme/themes/HelloWorldTheme/theme.skin @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Listings/Chapter9/Personalization/ClientCallback.aspx b/Listings/Chapter9/Personalization/ClientCallback.aspx new file mode 100644 index 0000000..a694b65 --- /dev/null +++ b/Listings/Chapter9/Personalization/ClientCallback.aspx @@ -0,0 +1,89 @@ +<%@ page language="C#" %> +<%@ implements interface="System.Web.UI.ICallbackEventHandler"%> + + + + + + Untitled Page + + + + + +
+ + BasicBlue + SmokeAndGlass + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter9/Personalization/DATA/ASPNetDB.mdb b/Listings/Chapter9/Personalization/DATA/ASPNetDB.mdb new file mode 100644 index 0000000..5573e8b Binary files /dev/null and b/Listings/Chapter9/Personalization/DATA/ASPNetDB.mdb differ diff --git a/Listings/Chapter9/Personalization/Default.aspx b/Listings/Chapter9/Personalization/Default.aspx new file mode 100644 index 0000000..b5ca39a --- /dev/null +++ b/Listings/Chapter9/Personalization/Default.aspx @@ -0,0 +1,72 @@ +<%@ page language="C#" %> + + + + + + Untitled Page + + +
+ + BasicBlue + SmokeAndGlass + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + diff --git a/Listings/Chapter9/Personalization/Web.config b/Listings/Chapter9/Personalization/Web.config new file mode 100644 index 0000000..b38da54 --- /dev/null +++ b/Listings/Chapter9/Personalization/Web.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..7876335 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +#Apress Source Code + +This repository accompanies [*ASP.NET 2.0 Revealed*](http://www.apress.com/9781590593370) by Patrick Lorenz (Apress, 2004). + +![Cover image](9781590593370.jpg) + +Download the files as a zip using the green button, or clone the repository to your machine using Git. + +##Releases + +Release v1.0 corresponds to the code in the published book, without corrections or updates. + +##Contributions + +See the file Contributing.md for more information on how you can contribute to this repository. diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..f6005ad --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to Apress Source Code + +Copyright for Apress source code belongs to the author(s). However, under fair use you are encouraged to fork and contribute minor corrections and updates for the benefit of the author(s) and other readers. + +## How to Contribute + +1. Make sure you have a GitHub account. +2. Fork the repository for the relevant book. +3. Create a new branch on which to make your change, e.g. +`git checkout -b my_code_contribution` +4. Commit your change. Include a commit message describing the correction. Please note that if your commit message is not clear, the correction will not be accepted. +5. Submit a pull request. + +Thank you for your contribution! \ No newline at end of file