Here is a way to be able to modify the Email Address from myaccount.aspx. I must give credit to Gjerstad for the posting at
http://p2p.wrox.com/topic.asp?TOPIC_ID=1389
Anyway the code in bold is new code for the code behind on myaccount.aspx for the button click event:
private void SubmitChanges_Click(object sender, System.EventArgs e)
{
// formulate a call to the update method on the user object to
// save the user changes to the database.
SaveMessage.Visible = false;
if (Page.IsValid)
{
if ( ((SiteIdentity)User.Identity).TestPassword( CurrentPassword.Text) == 0)
{
// display appropriate password failure message
SaveMessage.Text = "The password you supplied is incorrect.<br>";
SaveMessage.Visible = true;
}
else
{
try
{
Wrox.WebModules.Accounts.Business.User currentUser =
new Wrox.WebModules.Accounts.Business.User(
(Wrox.WebModules.Accounts.Business.PhilePrincipal) Context.User);
//This if statment is new code; initials developerz
//http://p2p.wrox.com/topic.asp?TOPIC_ID=1389
if (currentUser.EmailAddress != EmailAddress.Text)
{
FormsAuthentication.SetAuthCookie( EmailAddress.Text, true );
}
currentUser.FirstName = FirstName.Text;
currentUser.LastName = LastName.Text;
currentUser.Address1 = Address1.Text
...............then the rest of the code
Just make sure you test this code. It works for me, but may not be the best solution.
Take care,
developerz