protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { //Label1.Text = "Welcome, " + Session["Username"].ToString(); ScriptManager.RegisterStartupScript(this, this.GetType(), "hideDivs", "hideDivs();", true); ScriptManager.RegisterStartupScript(this, this.GetType(), "hideContainer", "hideContainer();", true); //Load data for jsTree nf.GetFormattedHTML(); //populate list of destination folders ddlDestinations.Items.Clear(); DirectoryInfo dirs = new DirectoryInfo(Server.MapPath(@"~\Images\Portfolio")); ddlDestinations.Items.Add("Choose a Destination"); foreach (DirectoryInfo d in dirs.GetDirectories()) { ddlDestinations.Items.Add(d.Name); } ddlDestinations.Items.Add("[Create New...]"); } else { //Refresh jsTree data nf.GetFormattedHTML(); ScriptManager.RegisterStartupScript(this, this.GetType(), "refreshTree", "refreshTree();", true); } }
public void UploadImage(string imageData, string path, string fileName) { string fullPath = Server.MapPath(path); using (FileStream fs = new FileStream(fullPath, FileMode.Create)) { using (BinaryWriter bw = new BinaryWriter(fs)) { byte[] data = Convert.FromBase64String(imageData); bw.Write(data); bw.Close(); } } nf.GetFormattedHTML(); }
protected void Page_Load(object sender, EventArgs e) { nf.GetFormattedHTML(); if (!Page.IsPostBack) { ddlCats.Items.Clear(); DirectoryInfo dirs = new DirectoryInfo(Server.MapPath(@"~\Images\Portfolio")); foreach (DirectoryInfo d in dirs.GetDirectories()) { ddlCats.Items.Add(d.Name); } } }