Re: What Image is Being Displayed

  •  06-29-2006, 6:15 PM

    Re: What Image is Being Displayed

    K2Jeff,
     
    I don't know why they don't expose the filename they must load it.  Here is what I do.
     
    ---
     
    System.Web.UI.HtmlControls.HtmlInputControl ImageNumber = (System.Web.UI.HtmlControls.HtmlInputControl)imagegallery.Controls[0];
    if (ImageNumber.Value != "")
    {

    //Displaying actual picture

    XmlDocument doc = new XmlDocument();

    doc.Load(HttpContext.Current.Server.MapPath(imagegallery.FolderPath + "//gallery.xml"));

    XmlNodeList nodelist = doc.SelectNodes("NewDataSet/image");

    for (int i = 0; i < nodelist.Count; i++)

    {

    if (nodelistIdea [I].SelectSingleNode("id").InnerText == ImageNumber.Value)

    {

    Link.Visible = true;

    Link.Text = "http://www.yourbiblestudy.com" + imagegallery.FolderPath.Substring(1,imagegallery.FolderPath.Length-1) + "/" + nodelistIdea [I].SelectSingleNode("url").InnerText;

    break;

    }

    }

    }

    else

    Link.Visible = false;
     
     
    ----
     
    You can get the id from the hidden htlm input then just parse the xml and read in the file name.  I am displaying it in a label called Link.  My DotNetGallery.Gallery is named imagegallery in the code above.
     
    Good luck.
View Complete Thread