Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
650
WebImageViewer1 Image Binding Question
posted

Good Morning All

Am using WebImageViewer1 in my page, am not used to this wizards Controls , i always write the code myself. but here things are stringe . i have images in my projects in the Images Folder. how can i display (Bind)the images in the WebImageViewer1.

Thank you

  • 65
    Suggested Answer
    posted

    Hello,

    You can bind the images using the following code snippet:

    protected void Page_Load(object sender, EventArgs e)
        {
            if (this.IsPostBack) return;
            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/16_excel.gif", "images", "hello"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/16_print.gif", "images", "hello1"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/bankingbtn.gif", "images", "hello2"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/billpay.gif", "images", "hello3"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/Blue hills.jpg", "images", "hello4"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/OpenBook.bmp", "images", "hello5"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/public.gif", "images", "hello6"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/Sunset.jpg", "images", "hello7"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/taxes.gif", "images", "hello8"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/Water lilies.jpg", "images", "hello9"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/favorites_hov.gif", "images", "hello10"));

            this.WebImageViewer1.Items.Add(new Infragistics.Web.UI.ListControls.ImageItem("./images/Winter.jpg", "images", "hello11"));

        }


    You can also bind the images via client side; for this you may refer the following online help article:

    <http://help.infragistics.com/Help/NetAdvantage/ASPNET/2009.1/CLR3.5/html/WebImageViewer_Adding_Images_to_the_WebImageViewer_on_the_Clientside.html>

    Thanks.

    Puneet