asp.net链接按钮图像回传后不可见 [英] asp.net Link button image not visible after postback

查看:162
本文介绍了asp.net链接按钮图像回传后不可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有图像的链接按钮和里面的标签。
回传之后,图像和标签是不可见的。

I have a link button with image and label inside it. After postback, the image and label is not visible.

< asp:LinkButton ID="AddNewRunLinkButton" runat="server" CssClass="Navigationlocalnav"
OnClick="AddNewRunLinkButton_Click" >
&nbsp;
  < img id="Img1" src="../../Images/add_newIcon.gif" runat="server" alt="Add New Run" />
  < asp:Label ID="addText" Text=" Add New Run" runat="server"></asp:Label>
< /asp:LinkButton>

此链接按钮用于导入/导出数据。我已经在这个链接按钮(AddNewRunLinkBut​​ton)的点击添加的属性,以显示使用javascript进度条 - setInterval函数。
如果我删除该属性,则越来越显示的图像和标签,否则是越来越只显示链接按钮。<​​/ P>

This link button is used to import/export data. I have added an attribute on click of this link button(AddNewRunLinkButton) to display a progress bar using javascript - SetInterval function. If I remove this attribute, the image and label is getting displayed, otherwise only link button is getting displayed.

AddNewRunLinkButton.attributes.add("onclick","javascript:DisplayProgress()");

function DisplayProgress()
{
  timeid = setInterval("addBlock",100)
}

function Addblock()
{
 // Display a progress bar as follows - Increase the width of a div tag at this interval
}

任何帮助吗?

推荐答案

我会用异步调用显示进度条,而不是你在做什么在这里。有时,当你连接客户端端和服务器端事件,页面渲染不起作用预期。在这种情况下,你使用的是带有setInterval的一个JavaScript计时器,我相信是造成拉布勒消失。

I would use Async call to show the progress bar as opposed to what you are doing here. Sometime when you attach both client side and server side events, the page rendering doesnt work as expected. In this case you are using a Javascript timer with SetInterval and I believe that is causing the lable to disappear.

这篇关于asp.net链接按钮图像回传后不可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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