Sie sind auf Seite 1von 4

web.

config

<?xml version="1.0"?> <!-For more information on how to configure your ASP.NET application, please visi t http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <authentication mode="Forms"></authentication> <authorization> <deny users="?"/> </authorization> <profile> <properties> <add name="BGColor" defaultValue="White"/> </properties> </profile>

<compilation debug="false" targetFramework="4.0" /> </system.web> </configuration> ---------------------------------------------------------------------UserSettings.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="UserSettings.aspx.cs" In herits="UserSettings" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <h1>User Settings</h1> <hr /> Enter background color for your home page: <asp:TextBox runat="server" ID="txtbgcolor" /> <asp:Button Text="Save my settings" runat="server" ID="btnSave" onclick="btnSave_Click" /> </div> </form> </body> </html> -------------------------------------------------------------------------UserSettings.aspx.cs

using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls;

public partial class UserSettings : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSave_Click(object sender, EventArgs e) { Profile.BGColor= txtbgcolor.Text; Response.Redirect("Default.aspx"); } }

------------------------------------------------------------------------Default.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherit s="_Default" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body id="doc" runat="server"> <form id="form1" runat="server"> <div> <div> <h1> Welcome</h1> <a href="UserSettings.aspx">User Settings</a> </div> </body> </div> </form> </body> </html>

-----------------------------------------------------------------------Defaault.aspx.cs

using using using using using using

System; System.Collections.Generic; System.Linq; System.Web; System.Web.UI; System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { doc.Attributes.Add("bgcolor", Profile.BGColor); } }

---------------------------------------------------------------------Login.aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits= "Login" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.or g/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Login ID="Login1" runat="server" BackColor="#F7F6F3" BorderColor="# E6E2D8" BorderPadding="4" BorderStyle="Solid" BorderWidth="1px" Font-Names=" Verdana" Font-Size="0.8em" ForeColor="#333333"> <InstructionTextStyle Font-Italic="True" ForeColor="Black" /> <LoginButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderSt yle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em" ForeCol or="#284775" /> <TextBoxStyle Font-Size="0.8em" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" Font-Size="0.9e m" ForeColor="White" /> </asp:Login> <br /> <br /> </div> <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" BackColor="#F7F6

F3" BorderColor="#E6E2D8" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" Font-Size="0.8em"> <ContinueButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <CreateUserButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <TitleTextStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" / > <WizardSteps> <asp:CreateUserWizardStep runat="server" /> <asp:CompleteWizardStep runat="server" /> </WizardSteps> <HeaderStyle BackColor="#5D7B9D" BorderStyle="Solid" Font-Bold="True" Font-Size="0.9em" ForeColor="White" HorizontalAlign="Center" /> <NavigationButtonStyle BackColor="#FFFBFF" BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" Font-Names="Verdana" ForeColor="#284775" /> <SideBarButtonStyle BorderWidth="0px" Font-Names="Verdana" ForeColor="Wh ite" /> <SideBarStyle BackColor="#5D7B9D" BorderWidth="0px" Font-Size="0.9em" VerticalAlign="Top" /> <StepStyle BorderWidth="0px" /> </asp:CreateUserWizard> </form> </body> </html> ------------------------------------------------------------------------------------

Das könnte Ihnen auch gefallen