[CLOSED] Image Viewer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    [CLOSED] Image Viewer

    Hi,

    I was trying to use a Data View and a Store to make the thumbnail of this Image Viewer control but it didn't work out. Now, to generate the thumbnail I use image buttons and the image is generated by a streaming page. I dynamically add this image buttons. The problem I am having right now is on the click event.

    I have attached the solution + the website (add it to the IIS) without the Coolite dlls (v.0.8.1).

    Basically I Register the script on the client on the control's onPreRender event with this

    const string resourceName = "ImageViewer.COBISImageViewerJS.js";
    ScriptManager.RegisterClientScriptInclude(typeof(COBISImageViewer), resourceName);
    The simple Script I add (its on the COBISImageViewerJS.js file )
    function loadImage(imageUrl) {
        Coolite.AjaxMethods.ReloadImage(imageUrl);
    }
    Create the buttons dynamically with this on the OnLoad event
      foreach (var image in _imagesContainer)
                {
                    Coolite.Ext.Web.ImageButton imgButton = new Coolite.Ext.Web.ImageButton();
                    imgButton.ImageUrl = @"http://localhost/WebSiteTestImageViewer/COBISImageViewerPage.aspx?path=" +
                                         image.ImageUrl;
                    imgButton.Listeners.Click.Handler = "loadImage('" + imgButton.ImageUrl + "');";
                    _leftPanel.BodyControls.Add(imgButton);
                    _leftPanel.BodyControls.Add(new LiteralControl("<p>"));
                    _leftPanel.BodyControls.Add(new LiteralControl("<span style=\"text-align:center;\">Text</span>"));
                    _leftPanel.BodyControls.Add(new LiteralControl("</p>"));
    
                }
    And of course the AjaxMethod wich in theory, it will help me remove the current image and add the selected one.

    [AjaxMethod]
            public void ReloadImage(string url)
            {
                _mainPanel.BodyControls.Remove(_mainImage);
                Coolite.Ext.Web.Image img = new Coolite.Ext.Web.Image();
                img.ImageUrl = url;
                _mainImage = img;
                _mainPanel.BodyControls.Add(img);
                _mainPanel.Reload();
            }

    I think this one is giving me the problems
    imgButton.Listeners.Click.Handler = "loadImage('" + imgButton.ImageUrl + "');";
    Am I using something wrong? I am getting this error.

    Microsoft JScript runtime error: Object expected
    Attached Files
    Last edited by geoffrey.mcgill; Jul 28, 2010 at 9:03 PM.

Similar Threads

  1. Crystal Report Viewer is not showing?
    By sadeque in forum 1.x Help
    Replies: 6
    Last Post: Nov 10, 2011, 3:43 PM
  2. Thumbnail Viewer
    By walle in forum 1.x Help
    Replies: 13
    Last Post: Dec 09, 2010, 8:15 AM
  3. Custom Report Viewer
    By harinarayanan123 in forum 1.x Help
    Replies: 0
    Last Post: Aug 19, 2010, 10:47 AM
  4. [CLOSED] [1.0] PDF Viewer in Tab
    By rcaunt in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: May 17, 2010, 10:49 AM
  5. [CLOSED] [1.0] Examples Viewer in Firefox
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 12, 2009, 4:17 AM

Posting Permissions