Skip to content

Commit

Permalink
Updated UserEdit page to display membership errors on the page. Issue…
Browse files Browse the repository at this point in the history
… # 318.
  • Loading branch information
ccoulson committed Jul 22, 2011
1 parent 4f50244 commit 49d6879
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@
<table border="0" width="100%" cellspacing="0" cellpadding="0" class="ms-descriptiontext">
<wssuc:InputFormSection runat="server" Title="User Name">
<template_inputformcontrols>
<asp:Label ID="lblMessage" runat="server" Text="" ForeColor="red"></asp:Label>
<wssuc:InputFormControl runat="server" LabelText="Username is read only:">
<Template_Control>
<SharePoint:InputFormTextBox Title="Username" Enabled="false" ReadOnly="true" class="ms-input" Columns="40" maxlength="255" ID="txtUsername" Direction="LeftToRight" Runat="server" />
<SharePoint:InputFormRequiredFieldValidator ID="InputFormRequiredFieldValidator1" ControlToValidate="txtUsername" Display="Dynamic" Runat="server"/>
<asp:Label ID="usernameMessage" runat="server" Text="" ForeColor="red"></asp:Label>

</Template_Control>
</wssuc:InputFormControl>
</template_inputformcontrols>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,15 @@ protected void OnSubmit(object sender, EventArgs e)
{
user.UnlockUser();
}
Membership.UpdateUser(user);

try
{
Membership.UpdateUser(user);
}
catch (System.Configuration.Provider.ProviderException ex)
{
lblMessage.Text = ex.Message;
return;
}
// update sharepoint user info
if (spuser != null)
{
Expand Down

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

0 comments on commit 49d6879

Please sign in to comment.