Jul 26, 2010, 8:31 PM
[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
I think this one is giving me the problems
Am I using something wrong? I am getting this error.
Microsoft JScript runtime error: Object expected
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 + "');";
Microsoft JScript runtime error: Object expected
Last edited by geoffrey.mcgill; Jul 28, 2010 at 9:03 PM.