示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        UserName = ClsUtil.ObjToStr(Request["u"]);
        if (Membership.GetUser(UserName) == null) {
            lblContent.Text = "<p>Unknown user: "******"</p>";
            return;
        }

        if (!IsPostBack)
        {
            init();
        }
        else
        {
            if (Request["btnSubmit"] != null)
            {
                string errMsg = new ClsProfile().saveProfile(UserName, Request);
                init();
                if (errMsg != "")
                {
                    errMsg = "<div class=\"error\">" + errMsg.Replace("\n", "<br/>") + "</div>";
                    lblContent.Text += errMsg;
                }
                else
                {
                    lblContent.Text +=
                        "<div class=\"info\">Profile of user '" + UserName + "' is updated.</div><script>$('.info').hide('fade', {}, 5000);</script>";
                }
            }
        }
    }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack) {
         init();
     }
     else
     {
         if (Request["btnSubmit"] != null)
         {
             string errMsg = new ClsProfile().saveProfile(User.Identity.Name, Request);
             init();
             if (errMsg != "")
             {
                 errMsg = "<div class=\"error\">" + errMsg.Replace("\n", "<br/>") + "</div>";
                 lblContent.Text += errMsg;
             }
             else {
                 lblContent.Text +=
                     "<div class=\"info\">Your profile is updated.</div><script>$('.info').hide('fade', {}, 5000);</script>";
             }
         }
     }
 }