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
The simple Script I add (its on the COBISImageViewerJS.js file )Code:const string resourceName = "ImageViewer.COBISImageViewerJS.js";
ScriptManager.RegisterClientScriptInclude(typeof(COBISImageViewer), resourceName);
Create the buttons dynamically with this on the OnLoad eventCode:function loadImage(imageUrl) {
Coolite.AjaxMethods.ReloadImage(imageUrl);
}
And of course the AjaxMethod wich in theory, it will help me remove the current image and add the selected one.Code: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>"));
}
Code:[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
Am I using something wrong? I am getting this error.Quote:
imgButton.Listeners.Click.Handler = "loadImage('" + imgButton.ImageUrl + "');";
Microsoft JScript runtime error: Object expected