What Image is Being Displayed

Last post 06-29-2006, 6:15 PM by jasonc. 3 replies.
Sort Posts: Previous Next
  •  05-24-2006, 11:25 PM 19489

    What Image is Being Displayed

    Is there an exposed propery or other method for me to capture the file name being displayed?  I'm looking for a way for users to add comments related to particular images and I want to automatically save the image file name with the comment.  Thanks.
  •  05-26-2006, 3:26 AM 19542 in reply to 19489

    Re: What Image is Being Displayed

    Just some clarification to help make this an easier question (I hope)... 
     
    I need to programmatically capture the file name of the currently displayed image within the gallery control.  Is there a way to do this?  If not, then I need to move on to a different photo album solution as this is a requirement for the application being developed.  A quick response would be appreciated.  Thanks.
  •  05-28-2006, 11:05 PM 19581 in reply to 19542

    Re: What Image is Being Displayed

    No, the image is beiing displayed is dynamically databinded to the current page. You can not capture the file name.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  06-29-2006, 6:15 PM 20605 in reply to 19581

    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 as RSS news feed in XML