|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using INCT.FNHProviders;
using System.Web.Security;
using System.Configuration;
namespace FNHCustomProviders.SampleApp
{
public partial class EditUser : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string au = Page.User.Identity.Name;
if (Page.User.Identity.IsAuthenticated)
this.UserInfo1.LoggedinName = String.Format("Welcome : {0}", au);
else
Server.Transfer("~/Default.aspx");
if (!IsPostBack)
{
MembershipUser userInfo = Membership.GetUser(au);
if (userInfo == null)
{
Server.Transfer("~/Default.aspx");
}
else
{
this.txtUsernm.Text = userInfo.UserName;
this.txtEmail.Text = userInfo.Email;
}
}
}
protected void update_Click(object sender, EventArgs e)
{
MembershipUser userInfo = Membership.GetUser(this.txtUsernm.Text);
if (userInfo == null)
{
Server.Transfer("~/Default.aspx");
}
else
{
userInfo.Email= this.txtEmail.Text;
Membership.UpdateUser(userInfo);
this.lblEmail.Text = "The email was updated";
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Lead Enterprise Application development and architecture using Asp.net/C#/Ajax/SSIS with back end databases like Ms-SQL, Oracle.
You can contact me at suhel.shah@gmail.com