图像对象无法在后面的代码中访问 [英] Image Object can not acces in code behind

查看:101
本文介绍了图像对象无法在后面的代码中访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



< asp:ScriptManager ID =ScriptManager1runat =server>



< asp :UpdatePanel ID =UpdatePanel1runat =server>

< contenttemplate>

< asp:Image ID =Image1Height =200pxWidth =200pxrunat =server/>

< asp:计时器ID =Timer1runat =serverInterval =1000ontick =Timer1_Tick>














<asp:ScriptManager ID="ScriptManager1" runat="server">

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<contenttemplate>
<asp:Image ID="Image1" Height="200px" Width="200px"runat="server" />
<asp:Timer ID="Timer1" runat="server" Interval="1000" ontick="Timer1_Tick">








i我正在使用更新面板来移动图片幻灯片,但是当我使用image1.ImageUrl然后

错误即将到来image1在当前不存在上下文为什么我不知道

plz help


i am using Update panel to displat image slideshow but when ever i am using image1.ImageUrl then
error is comming image1 does not exist in current context why i dont konw
plz help

推荐答案

从中移除 Image1 控件页面,保存。并再次在页面中添加相同的控件,保存它。通过执行此操作,它将更新页面的设计器文件...

注意:照顾所有语法。
Remove the Image1 control from the page , save it. and once again add the same contorl in the page, save it. by doing this it will update the designer file of the page...
note:Take care of all the syntax.


更新面板中的内容可以在内容模板中存在。因此,在updatepanel下添加内容模板,然后在contenttemplet中添加您的代码
Your content in the update panel sould b presnt in content templet. So under updatepanel add content templet then add your code in contenttemplet


这篇关于图像对象无法在后面的代码中访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆