Note that there are some explanatory texts on larger screens.

plurals
  1. POi uploaded a image files by creating a sub folder in Images Folder dynamically from ModelName but cant retrieve them from that sub folder
    primarykey
    data
    text
    <h1>Here is my Code:</h1> <p>i m using just a simple datalist to display images form folder...</p> <blockquote> <p>showing me error after clicking on broke image icon in datalist The resource cannot be found.</p> <blockquote> <p>Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. </p> <blockquote> <p>Requested URL: /WebSite2/Images/Desert.jpg</p> </blockquote> </blockquote> </blockquote> <pre><code>protected void BindDataList() { DirectoryInfo dir = new DirectoryInfo(MapPath(@"~/Images/"+Model.Text+"/")); FileInfo[] files = dir.GetFiles(); ArrayList listItems = new ArrayList(); foreach (FileInfo info in files) { listItems.Add(info); } DataList1.DataSource = listItems; DataList1.DataBind(); } protected void upload_Click(object sender, EventArgs e) { string filename = Path.GetFileName(FileUpload1.PostedFile.FileName); FileUpload1.SaveAs(Server.MapPath("Images/"+Model.Text+"/" + filename)); BindDataList(); } protected void newfolder_Click(object sender, EventArgs e) { string NewDirectory = Server.MapPath("Images/"+Model.Text); //New Directory Name in string variable CreateDirectoryIfNotExists(NewDirectory); //Calling the function to create new directory } private void CreateDirectoryIfNotExists(string NewDirectory) { try { // Checking the existance of directory if (!Directory.Exists(NewDirectory)) { //If No any such directory then creates the new one Directory.CreateDirectory(NewDirectory); Label1.Text = "Directory Created"; } else { Label1.Text = "Directory Exist"; } } catch (IOException _err) { Label1.Text = _err.Message; ; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload