示例#1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string u = Session[Constants.Session.ID].ToString();
        string spath = "", fname = "", path = "";

        if (FileUpload1.HasFile)
        {
            fname = FileUpload1.FileName;
            path  = Server.MapPath("/user/Profilepic/" + u + fname);
            FileUpload1.SaveAs(path);
            spath = "/user/Profilepic/" + u + fname;
            c.UploadPropilepic(u, fname, spath);
            Image1.ImageUrl = spath;
        }
        else
        {
            Response.Write("<script>alert('Plz Select Picture');</script>");
        }
    }