0

我正在尝试自动化我的 WebImageViewer ..当页面加载时,查看器应该浏览其中的幻灯片/图像..我找到了一些关于如何实现的示例,但我发现的最好的示例似乎给出了一个例外,我似乎无法找出原因。这是下面的代码和异常:-

    <ig:WebImageViewer ID="WebImageViewer1" runat="server" BorderColor="#990000" 
    BorderStyle="Groove" 



    style="z-index: 1; left: 221px; top: 300px; position: absolute; height: 576px; width: 720px" 
    BorderWidth="2px">
    <Header Text="CDMS Features" Visible="True">
    </Header>
    <Footer Text="CDMS© is a product of Blue Barracuda Technologies" Visible="True">
    </Footer>
    <Items>
    <ClientEvents Initialize="ivInit" />
    <ScrollAnimations Type="NextItem" />
        <ig:ImageItem ImageUrl="~/Styles/DiagnosisSlider.png" 
            NavigateUrl="http://localhost:9480/Default.aspx" />
        <ig:ImageItem ImageUrl="~/Styles/MedbookSlide.png" />
        <ig:ImageItem ImageUrl="~/Styles/ASKDOCSlider.png" />
    </Items>


</ig:WebImageViewer>

<script language="javascript" type="text/javascript">
       var imageViewer = null;
       function ivInit(ivCSO)
       {
           imageViewer = ivCSO;
           window.setInterval('imageViewer.navigateNext();', 3000);

       }

</script>

我得到的异常:解析器错误消息:Infragistics.Web.UI.ListControls.ImageItemCollection 必须具有“Infragistics.Web.UI.ListControls.ImageItem”类型的项目。“ClientEvents”的类型为“System.Web.UI.HtmlControls.HtmlGenericControl”。

有任何想法吗?帮助真的很感激。

4

1 回答 1

1

The error that you are getting is because the ClientEvents is within the Items collection and it shouldn't be. The correct markup is:

<ig:WebImageViewer ID="WebImageViewer1" runat="server" BorderColor="#990000" BorderStyle="Groove"
    Style="z-index: 1; left: 221px; top: 300px; position: absolute; height: 576px;
    width: 720px" BorderWidth="2px">
    <Header Text="CDMS Features" Visible="True">
    </Header>
    <Footer Text="CDMS© is a product of Blue Barracuda Technologies" Visible="True">
    </Footer>
    <ClientEvents Initialize="ivInit" />
    <ScrollAnimations Type="NextItem" />
    <Items>
        <ig:ImageItem ImageUrl="~/Styles/DiagnosisSlider.png" NavigateUrl="http://localhost:9480/Default.aspx" />
        <ig:ImageItem ImageUrl="~/Styles/MedbookSlide.png" />
        <ig:ImageItem ImageUrl="~/Styles/ASKDOCSlider.png" />
    </Items>
</ig:WebImageViewer>
于 2012-04-20T19:10:44.107 回答