Exemplo n.º 1
0
        //创建社团
        protected void ButtonCreate_Click(object sender, EventArgs e)
        {
            string SocName = TextBoxName.Text;
            int    SocSize = int.Parse(TextBoxSize.Text);
            string Sk      = TextBoxSk.Text;

            string[] str = { SocName.Trim(), Session["username"].ToString(), Sk.ToString(), TextBoxSize.Text, Session["pictureURL"].ToString() };
            if (!(user.InsertSocial(str)))
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('创建失败,已有该社团!');</script>");
            }
            else
            {
                this.ClientScript.RegisterStartupScript(this.GetType(), "", "<script>alert('创建成功!');window.location.href='Default2.aspx'</script>");
                //Response.Write("<script>alert('创建成功!');window.location.href='indexTrue.aspx'</script>");
            }
        }