rap2:
Thank you for helping but neither of those solutions will work. I am trying to populate fields (textboxes) in a seperate form so that they can be used to create other data I need as an admin and to be included in an email sent to the user . Has to be some kind of security issue in the password control. Any other ideas?
You need to make sure that you the Membership "EnablePasswordRetrieval" property to true , so that you can use Membership.GetPassword method:
set the Property in membershipProvider Settings in web.config ,
<membership defaultProvider="SqlMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear/>
<add name="SqlMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="ASPNETSECURITY"
applicationName="Development"
enablePasswordRetrieval="true"
enablePasswordReset="false"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="true"
passwordFormat="Clear"
minRequiredPasswordLength="1"
/>
</providers>
</membership>
then you can Print the Authenticated User data as follows:
if (Request.IsAuthenticated)
{
MembershipUser usr=Membership.GetUser();
Response.Write("<b>UserName</b> " + usr.UserName);
Response.Write("<br/>");
Response.Write("<b>Password </b> " + usr.GetPassword());
Response.Write("<br/>");
Response.Write("<b> LastActivity </b> " + usr.LastActivityDate.ToShortDateString());
}
Hope that Helps
Best Regards,
Anas Ghanem - انس الغانم |
My Blog