Codice sorgente del file: CreateUserWizard.aspx

ASP.NET
<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
	protected void CreateUserWizard1_CreatedUser(object sender, System.EventArgs e)
	{
		ProfileCommon _profile = (ProfileCommon)ProfileCommon.Create(CUWizard1.UserName);
		_profile.Skin = ((DropDownList)(CUWizard1.CreateUserStep.ContentTemplateContainer.FindControl("Skins"))).SelectedValue;
		_profile.AlbumPreferito.Titolo = ((TextBox)(CUWizard1.CreateUserStep.ContentTemplateContainer.FindControl("AlbumTitle"))).Text;
		_profile.Save();
	}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
	<title>CreateUserWizard - Capitolo 23</title>
</head>
<body>
	<form id="form1" runat="server">
		<div>
			<asp:CreateUserWizard ID="CUWizard1" runat="server" OnCreatedUser="CreateUserWizard1_CreatedUser">
				<WizardSteps>
					<asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
						<ContentTemplate>
							<table border="0">
								<tbody>
									<tr>
										<td align="center" colspan="2">
											Sign Up for Your New Account</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="UserName">User Name:</asp:Label></td>
										<td>
											<asp:TextBox ID="UserName" runat="server"></asp:TextBox>
											<asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="UserName"
												ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">Password:</asp:Label></td>
										<td>
											<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox>
											<asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
												ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="ConfirmPasswordLabel" runat="server" AssociatedControlID="ConfirmPassword">Confirm Password:</asp:Label></td>
										<td>
											<asp:TextBox ID="ConfirmPassword" runat="server" TextMode="Password"></asp:TextBox>
											<asp:RequiredFieldValidator ID="ConfirmPasswordRequired" runat="server" ControlToValidate="ConfirmPassword"
												ErrorMessage="Confirm Password is required." ToolTip="Confirm Password is required."
												ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="EmailLabel" runat="server" AssociatedControlID="Email">E-mail:</asp:Label></td>
										<td>
											<asp:TextBox ID="Email" runat="server"></asp:TextBox>
											<asp:RequiredFieldValidator ID="EmailRequired" runat="server" ControlToValidate="Email"
												ErrorMessage="E-mail is required." ToolTip="E-mail is required." ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="QuestionLabel" runat="server" AssociatedControlID="Question">Security Question:</asp:Label></td>
										<td>
											<asp:TextBox ID="Question" runat="server"></asp:TextBox>
											<asp:RequiredFieldValidator ID="QuestionRequired" runat="server" ControlToValidate="Question"
												ErrorMessage="Security question is required." ToolTip="Security question is required."
												ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="AnswerLabel" runat="server" AssociatedControlID="Answer">Security Answer:</asp:Label></td>
										<td>
											<asp:TextBox ID="Answer" runat="server"></asp:TextBox>
											<asp:RequiredFieldValidator ID="AnswerRequired" runat="server" ControlToValidate="Answer"
												ErrorMessage="Security answer is required." ToolTip="Security answer is required."
												ValidationGroup="CUWizard1">*</asp:RequiredFieldValidator>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="SkinsLabel" runat="server" AssociatedControlID="Skins">Il tuo skin:</asp:Label></td>
										<td>
											<asp:DropDownList ID="Skins" runat="server">
												<asp:ListItem>Skin 1</asp:ListItem>
												<asp:ListItem>Skin 2</asp:ListItem>
											</asp:DropDownList>
										</td>
									</tr>
									<tr>
										<td align="right">
											<asp:Label ID="AlbumTitleLabel" runat="server" AssociatedControlID="AlbumTitle">Il tuo album preferito:</asp:Label></td>
										<td>
											<asp:TextBox ID="AlbumTitle" runat="server" />
										</td>
									</tr>
									<tr>
										<td align="center" colspan="2">
											<asp:CompareValidator ID="PasswordCompare" runat="server" ControlToCompare="Password"
												ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="The Password and Confirmation Password must match."
												ValidationGroup="CUWizard1"></asp:CompareValidator>
										</td>
									</tr>
									<tr>
										<td align="center" colspan="2" style="color: red">
											<asp:Literal ID="ErrorMessage" runat="server" EnableViewState="False"></asp:Literal>
										</td>
									</tr>
								</tbody>
							</table>
						</ContentTemplate>
					</asp:CreateUserWizardStep>
					<asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server" />
				</WizardSteps>
			</asp:CreateUserWizard>
		</div>
	</form>
</body>
</html>

Nella stessa directory
Il libro

© 2008 books.ASPItalia.com - Vietata la riproduzione, anche parziale.