Hello,
I have assembled an admin page (since someone at M$ apparently thought it would be cute to not let us use WSAT on a production server!

).
If you have an admin role, the page consists of a drop-down list from which you can select a username (the default is your own username), which in turn pulls up that user's account (not the profile, the login stuff) in a DetailsView control. Additionally, if the selected account is not your own, a Delete button is provided. (We don't want to accidentally delete ourselves!)
I specified in ObjectDataSource1 / DELETE tab the option that says "Boolean deleteAllRelatedData", but through trial and error, I have discovered that only the Membership table record was deleted, not the Users table record. This user did not create a profile, but I am assuming if she had, then this record would not be deleted, either.
I want all traces of this user completely deleted from the system entirely.
This will then solve the problem of why my "Select User" drop-down list still shows the deleted user, even though WSAT indicates the user no longer exists. (It was DB Explorer that tipped me off about Users and Profiles tables not being affected as they should have.)
Below is the ASPX code in question....
Code:
<h1>Edit User Accounts</h1>
<!-- SELECT USER ACCOUNT //-->
<div class="bottomblueline"><asp:Label ID="Label1" runat="server" CssClass="bold" Text="Select User Name: " AssociatedControlID="ddlUserNames"></asp:Label>
<asp:DropDownList ID="ddlUserNames" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="UserName" DataValueField="UserName" TabIndex="1" onselectedindexchanged="ddlUserNames_SelectedIndexChanged"></asp:DropDownList>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SqlXpress %>" SelectCommand="SELECT [UserName] FROM [vw_aspnet_Users] ORDER BY [UserName]"></asp:SqlDataSource>
</div>
<!-- DISPLAY USER ACCOUNT //-->
<div class="topbottompadding"><asp:DetailsView AutoGenerateRows="False" DataSourceID="ObjectDataSource1" ID="DetailsView1" runat="server" OnItemUpdating="DetailsView1_ItemUpdating" CellPadding="0" CssClass="noborderline" DefaultMode="Edit" GridLines="Horizontal" Width="100%" onitemcreated="DetailsView1_ItemCreated"><Fields><asp:BoundField DataField="UserName" HeaderText="User Name" ReadOnly="True" SortExpression="UserName"/>
<asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" ControlStyle-Width="250px">
<ControlStyleWidth="250px"/>
</asp:BoundField>
<asp:BoundField DataField="PasswordQuestion" HeaderText="Password Question" ReadOnly="True" SortExpression="PasswordQuestion"></asp:BoundField>
<asp:CheckBoxField DataField="IsOnline" HeaderText="Online?" ReadOnly="True" SortExpression="IsOnline"/>
<asp:CheckBoxField DataField="IsApproved" HeaderText="Active?" SortExpression="IsApproved"/>
<asp:BoundField ControlStyle-Height="100px" ControlStyle-Width="250px" DataField="Comment" HeaderText="Comment" SortExpression="Comment">
<ControlStyle Height="100px" Width="250px"/>
</asp:BoundField>
<asp:BoundField DataField="CreationDate" HeaderText="Creation Date" ReadOnly="True" SortExpression="CreationDate"/>
<asp:BoundField DataField="LastActivityDate" HeaderText="Last Activity Date" ReadOnly="True" SortExpression="LastActivityDate"/>
<asp:BoundField DataField="LastLoginDate" HeaderText="Last Login Date" ReadOnly="True" SortExpression="LastLoginDate"/>
<asp:BoundField DataField="LastLockoutDate" HeaderText="Last Lockout Date" ReadOnly="True" SortExpression="LastLockoutDate"/>
<asp:BoundField DataField="LastPasswordChangedDate" HeaderText="Last Password Changed Date" ReadOnly="True" SortExpression="LastPasswordChangedDate"/>
<asp:BoundField DataField="ProviderName" HeaderText="Provider Name" ReadOnly="True" SortExpression="ProviderName"/>
<asp:BoundField DataField="ProviderUserKey" HeaderText="Provider User Key" ReadOnly="True" SortExpression="ProviderUserKey"/>
<asp:CommandField ButtonType="Button" ShowDeleteButton="True" ShowEditButton="True" UpdateText="Save Changes"></asp:CommandField>
<asp:CommandField ButtonType="Button" ShowEditButton="True" UpdateText="Save Changes"></asp:CommandField>
</Fields>
<CommandRowStyle CssClass="commandline"/>
<FieldHeaderStyle CssClass="bold"/>
<AlternatingRowStyle CssClass="gray"/>
</asp:DetailsView>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetUser" TypeName="System.Web.Security.Membership" DeleteMethod="DeleteUser" OldValuesParameterFormatString="original_{0}">
<DeleteParameters>
<asp:ControlParameter ControlID="ddlUserNames" Name="username" PropertyName="SelectedValue" Type="String"/>
<asp:Parameter Name="deleteAllRelatedData" Type="Boolean" DefaultValue="True" />
</DeleteParameters>
<SelectParameters>
<asp:ControlParameter ControlID="ddlUserNames" DefaultValue=" " Name="username" PropertyName="SelectedValue" Type="String"/>
</SelectParameters>
</asp:ObjectDataSource>
</div>
Any thoughts on this? Thanks in advance!
