I need to use WebImageViewer in two different way:the first is the classic one with prev and next button and there are not problem...The second is the classic slideshow, an automatic projection of all images with a delay and with shading effect...
I have thought to a client side timer... but with no a good result
Can I do this with the WebimageViewer?
I have an incident too .. about this request... I'm just a bit hurry...
Thank you in advance...
Hello,
You can use the Java Script method navigateNext () with this method you can navigate to next item. Also you can use the method setInterval(code, delay) and set delay of execution .In the WebImageViewer1 you can set the property Type=NextItem in ScrollAnimation tag. For starting of the slide show you can attach this code in onload event of the body tag.
Please take a look at the attached sample code below: <script type="text/javascript"> function SlideShow() { var viewer = $find("WebImageViewer1"); viewer.navigateNext(); } </script></head><body onload="setInterval('SlideShow()', 1000)"> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <div> <ig:WebImageViewer ID="WebImageViewer1" runat="server" Height="150px" Width="500px"> <ScrollAnimations Type="NextItem"> </ScrollAnimations> <Items> <ig:ImageItem ImageUrl="http://samples.infragistics.com/2008.2/webfeaturebrowser/images/WebImageViewer/image2.jpg" /> </Items> <Items> <ig:ImageItem ImageUrl=" http://samples.infragistics.com/2008.2/webfeaturebrowser/images/WebImageViewer/image3.jpg" /> </Items> <Items> <ig:ImageItem ImageUrl=" http://samples.infragistics.com/2008.2/webfeaturebrowser/images/WebImageViewer/image6.jpg " /> </Items> <Items> <ig:ImageItem ImageUrl=" http://samples.infragistics.com/2008.2/webfeaturebrowser/images/WebImageViewer/image5.jpg " /> </Items> </ig:WebImageViewer> </div> </form></body> For more information you can take a look at the links below:
http://www.elated.com/articles/javascript-timers-with-settimeout-and-setinterval/http://samples.infragistics.com/2009.1/WebFeatureBrowser/Default.aspxhttp://help.infragistics.com/NetAdvantage/ASPNET/2009.1/CLR3.5/Hope this helps.Thanks
Ivan Baev Developer support team Infragistics
Hi, i have little problem with ContentPage. How to do the same in ContentPage?
i tried like this
protected void Page_Load(object sender, EventArgs e)
{
string strScript = "<script type=\"text/javascript\"> function SlideShow() { var viewer = $find(\"WebImageViewer1\"); viewer.navigateNext(); } </script>";
body.Attributes.Add("onload", "setInterval('SlideShow()', 3000)");
this.ClientScript.RegisterClientScriptBlock(this.GetType(), "onload", strScript);
}
but it's still doesn't work. Please help me to find solution, thanks
I am also trying to scroll the images automatically. I am using the Javascript above and adding an onload event. However, I am receiving the following error:
"Microsoft JScript runtime error: 'null' is null or not an object"
WebImageViewer1 is the same name as my control also. However, I am using a master page, so I have to set my onload event this way:
protected void Page_Load(object sender, EventArgs e){HtmlGenericControl body = (HtmlGenericControl)Master.FindControl("MasterPageBodyTag");
body.Attributes.Add(
"onload", "setInterval('SlideShow()', 1000)");}
I tried added adding the WebImageViewer into an UpdatePanel, but has no success. I have an ID at the body on the master page called "MasterPageBodyTag", and it appears to be working for a test javascript alert().
Please help.
Thanks!
Eric Hintz