Esempio n. 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        DeleteButton.Attributes.Add("onclick", "return confirm('Are you sure you want to delete the selected messages?');");

        if (User.Identity.IsAuthenticated)
        {
            MembershipUser userObject = Membership.GetUser();
            string UserID = userObject.ProviderUserKey.ToString();

            pm = new MessageControl(UserID);

            if (pm.getCreatedProfile(User.Identity.Name) != "1")
            {
                Response.Redirect("CreateProfile.aspx");
            }

            //Label1.Text = pm.getUserId("sosuke");
            //Label2.Text = pm.getUserName(Label1.Text.ToString());
            //pm.sendMessage("sosuke", "test", "omg i love you!");
            //pm.toDeleted("4f561504-964e-492b-af24-7c506528a96a", 0);
            //pm.toViewed("4f561504-964e-492b-af24-7c506528a96a", 0);

            if (!Page.IsPostBack)
            {
                Repeater1.DataSource = pm.getMessages("sent");
                Repeater1.DataBind();
            }
        }
        else
        {
            Response.Redirect("Login.aspx?ReturnUrl=pmSent.aspx");
        }
    }