更新面板中的图像标记

时间:2013-01-31 13:56:34

标签: c# updatepanel image

我是.net的新手。我正在编写一个新的应用程序,我必须使用按钮控件显示图像的幻灯片。代码是

 <div id = "slideshow" style = "width:auto" runat="server" align ="center">
            <asp:Label ID = "slideHeader" runat="server" />
                 <asp:Image runat="server" ImageUrl=" " ID = "img" style="width:90%; height:100%;"/>
            <hr style = "height:20px; border:0px; color:White"  />
                    <asp:Button id="prev" Text="Previous" OnClick = "prevClick" runat="server"/>
                    <asp:Button id="next" Text="Next" OnClick = "nextClick" runat="server"/>
                    <asp:Button id="start" Text="Start" OnClick = "startClick" runat="server"/>
                    <asp:Button id="stop" Text="Stop" OnClick = "stopClick" runat="server"/>
            </div>

按钮背后的代码是

protected void nextClick(object sender, EventArgs e)
{

img.ImageUrl = path; 

}

我不知道如何使用更新面板。当我在img标签周围使用更新面板标签时,它显示更新面板没有属性img。我怎么能做到这一点?

0 个答案:

没有答案