Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsabri committed Sep 18, 2015
1 parent 64ac7a9 commit 8a774ea
Show file tree
Hide file tree
Showing 333 changed files with 137,652 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Demo.WebSite/About.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<%@ Page Title="About" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="About.aspx.cs" Inherits="Demo.WebSite.About" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<hgroup class="title">
<h1><%: Title %>.</h1>
<h2>Your app description page.</h2>
</hgroup>

<article>
<p>
Use this area to provide additional information.
</p>

<p>
Use this area to provide additional information.
</p>

<p>
Use this area to provide additional information.
</p>
</article>

<aside>
<h3>Aside Title</h3>
<p>
Use this area to provide additional information.
</p>
<ul>
<li><a runat="server" href="~/">Home</a></li>
<li><a runat="server" href="~/About.aspx">About</a></li>
<li><a runat="server" href="~/Contact.aspx">Contact</a></li>
</ul>
</aside>
</asp:Content>
17 changes: 17 additions & 0 deletions Demo.WebSite/About.aspx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo.WebSite
{
public partial class About : Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
}
}
17 changes: 17 additions & 0 deletions Demo.WebSite/About.aspx.designer.cs

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

47 changes: 47 additions & 0 deletions Demo.WebSite/Account/Login.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<%@ Page Title="Log in" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="Demo.WebSite.Account.Login" %>
<%@ Register Src="~/Account/OpenAuthProviders.ascx" TagPrefix="uc" TagName="OpenAuthProviders" %>

<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
<hgroup class="title">
<h1><%: Title %>.</h1>
</hgroup>
<section id="loginForm">
<h2>Use a local account to log in.</h2>
<asp:Login runat="server" ViewStateMode="Disabled" RenderOuterTable="false">
<LayoutTemplate>
<p class="validation-summary-errors">
<asp:Literal runat="server" ID="FailureText" />
</p>
<fieldset>
<legend>Log in Form</legend>
<ol>
<li>
<asp:Label runat="server" AssociatedControlID="UserName">User name</asp:Label>
<asp:TextBox runat="server" ID="UserName" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="UserName" CssClass="field-validation-error" ErrorMessage="The user name field is required." />
</li>
<li>
<asp:Label runat="server" AssociatedControlID="Password">Password</asp:Label>
<asp:TextBox runat="server" ID="Password" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="Password" CssClass="field-validation-error" ErrorMessage="The password field is required." />
</li>
<li>
<asp:CheckBox runat="server" ID="RememberMe" />
<asp:Label runat="server" AssociatedControlID="RememberMe" CssClass="checkbox">Remember me?</asp:Label>
</li>
</ol>
<asp:Button runat="server" CommandName="Login" Text="Log in" />
</fieldset>
</LayoutTemplate>
</asp:Login>
<p>
<asp:HyperLink runat="server" ID="RegisterHyperLink" ViewStateMode="Disabled">Register</asp:HyperLink>
if you don't have an account.
</p>
</section>

<section id="socialLoginForm">
<h2>Use another service to log in.</h2>
<uc:OpenAuthProviders runat="server" ID="OpenAuthLogin" />
</section>
</asp:Content>
24 changes: 24 additions & 0 deletions Demo.WebSite/Account/Login.aspx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Demo.WebSite.Account
{
public partial class Login : Page
{
protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx";
OpenAuthLogin.ReturnUrl = Request.QueryString["ReturnUrl"];

var returnUrl = HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
if (!String.IsNullOrEmpty(returnUrl))
{
RegisterHyperLink.NavigateUrl += "?ReturnUrl=" + returnUrl;
}
}
}
}
35 changes: 35 additions & 0 deletions Demo.WebSite/Account/Login.aspx.designer.cs

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

126 changes: 126 additions & 0 deletions Demo.WebSite/Account/Manage.aspx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<%@ Page Title="Manage Account" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Manage.aspx.cs" Inherits="Demo.WebSite.Account.Manage" %>
<%@ Register Src="~/Account/OpenAuthProviders.ascx" TagPrefix="uc" TagName="OpenAuthProviders" %>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">
<hgroup class="title">
<h1><%: Title %>.</h1>
</hgroup>

<section id="passwordForm">
<asp:PlaceHolder runat="server" ID="successMessage" Visible="false" ViewStateMode="Disabled">
<p class="message-success"><%: SuccessMessage %></p>
</asp:PlaceHolder>

<p>You're logged in as <strong><%: User.Identity.Name %></strong>.</p>

<asp:PlaceHolder runat="server" ID="setPassword" Visible="false">
<p>
You do not have a local password for this site. Add a local
password so you can log in without an external login.
</p>
<fieldset>
<legend>Set Password Form</legend>
<ol>
<li>
<asp:Label runat="server" AssociatedControlID="password">Password</asp:Label>
<asp:TextBox runat="server" ID="password" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="password"
CssClass="field-validation-error" ErrorMessage="The password field is required."
Display="Dynamic" ValidationGroup="SetPassword" />

<asp:ModelErrorMessage runat="server" ModelStateKey="NewPassword" AssociatedControlID="password"
CssClass="field-validation-error" SetFocusOnError="true" />

</li>
<li>
<asp:Label runat="server" AssociatedControlID="confirmPassword">Confirm password</asp:Label>
<asp:TextBox runat="server" ID="confirmPassword" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="confirmPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The confirm password field is required."
ValidationGroup="SetPassword" />
<asp:CompareValidator runat="server" ControlToCompare="Password" ControlToValidate="confirmPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The password and confirmation password do not match."
ValidationGroup="SetPassword" />
</li>
</ol>
<asp:Button runat="server" Text="Set Password" ValidationGroup="SetPassword" OnClick="setPassword_Click" />
</fieldset>
</asp:PlaceHolder>

<asp:PlaceHolder runat="server" ID="changePassword" Visible="false">
<h3>Change password</h3>
<asp:ChangePassword runat="server" CancelDestinationPageUrl="~/" ViewStateMode="Disabled" RenderOuterTable="false" SuccessPageUrl="Manage.aspx?m=ChangePwdSuccess">
<ChangePasswordTemplate>
<p class="validation-summary-errors">
<asp:Literal runat="server" ID="FailureText" />
</p>
<fieldset class="changePassword">
<legend>Change password details</legend>
<ol>
<li>
<asp:Label runat="server" ID="CurrentPasswordLabel" AssociatedControlID="CurrentPassword">Current password</asp:Label>
<asp:TextBox runat="server" ID="CurrentPassword" CssClass="passwordEntry" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="CurrentPassword"
CssClass="field-validation-error" ErrorMessage="The current password field is required."
ValidationGroup="ChangePassword" />
</li>
<li>
<asp:Label runat="server" ID="NewPasswordLabel" AssociatedControlID="NewPassword">New password</asp:Label>
<asp:TextBox runat="server" ID="NewPassword" CssClass="passwordEntry" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="NewPassword"
CssClass="field-validation-error" ErrorMessage="The new password is required."
ValidationGroup="ChangePassword" />
</li>
<li>
<asp:Label runat="server" ID="ConfirmNewPasswordLabel" AssociatedControlID="ConfirmNewPassword">Confirm new password</asp:Label>
<asp:TextBox runat="server" ID="ConfirmNewPassword" CssClass="passwordEntry" TextMode="Password" />
<asp:RequiredFieldValidator runat="server" ControlToValidate="ConfirmNewPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="Confirm new password is required."
ValidationGroup="ChangePassword" />
<asp:CompareValidator runat="server" ControlToCompare="NewPassword" ControlToValidate="ConfirmNewPassword"
CssClass="field-validation-error" Display="Dynamic" ErrorMessage="The new password and confirmation password do not match."
ValidationGroup="ChangePassword" />
</li>
</ol>
<asp:Button runat="server" CommandName="ChangePassword" Text="Change password" ValidationGroup="ChangePassword" />
</fieldset>
</ChangePasswordTemplate>
</asp:ChangePassword>
</asp:PlaceHolder>
</section>

<section id="externalLoginsForm">

<asp:ListView runat="server"
ItemType="Microsoft.AspNet.Membership.OpenAuth.OpenAuthAccountData"
SelectMethod="GetExternalLogins" DeleteMethod="RemoveExternalLogin" DataKeyNames="ProviderName,ProviderUserId">

<LayoutTemplate>
<h3>Registered external logins</h3>
<table>
<thead><tr><th>Service</th><th>User Name</th><th>Last Used</th><th>&nbsp;</th></tr></thead>
<tbody>
<tr runat="server" id="itemPlaceholder"></tr>
</tbody>
</table>
</LayoutTemplate>
<ItemTemplate>
<tr>

<td><%#: Item.ProviderDisplayName %></td>
<td><%#: Item.ProviderUserName %></td>
<td><%#: ConvertToDisplayDateTime(Item.LastUsedUtc) %></td>
<td>
<asp:Button runat="server" Text="Remove" CommandName="Delete" CausesValidation="false"
ToolTip='<%# "Remove this " + Item.ProviderDisplayName + " login from your account" %>'
Visible="<%# CanRemoveExternalLogins %>" />
</td>

</tr>
</ItemTemplate>
</asp:ListView>

<h3>Add an external login</h3>
<uc:OpenAuthProviders runat="server" ReturnUrl="~/Account/Manage.aspx" />
</section>
</asp:Content>
Loading

0 comments on commit 8a774ea

Please sign in to comment.