javascript中UpdateProgress的css值赋值

javascript中UpdateProgress的css值赋值,javascript,asp.net,updateprogress,Javascript,Asp.net,Updateprogress,我正在使用以下代码为asp.net updateprogress控件赋值,但运气不好 <script type="text/javascript"> var updateProgress=document.getElementById ('<%=UpdateProgressLinkActivity.ClientID%>'); updateProgress.style.position='absolute'; updateProgress.style.

我正在使用以下代码为asp.net updateprogress控件赋值,但运气不好

   <script type="text/javascript">
  var updateProgress=document.getElementById ('<%=UpdateProgressLinkActivity.ClientID%>');
   updateProgress.style.position='absolute';
   updateProgress.style.width='250px';
   updateProgress.style.height='100px';
   updateProgress.style.top='0px';
   updateProgress.style.left='0px';
  </script>

var updateProgress=document.getElementById(“”);
updateProgress.style.position='absolute';
updateProgress.style.width='250px';
updateProgress.style.height='100px';
updateProgress.style.top='0px';
updateProgress.style.left='0px';

控件名是复制粘贴。

您可以在函数中添加此代码,并在事件中添加此代码(例如onload)


函数VisibledProgress()
{
var updateProgress=document.getElementById(“”);
updateProgress.style.position='absolute';
updateProgress.style.width='250px';
updateProgress.style.height='100px';
updateProgress.style.top='0px';
updateProgress.style.left='0px';
} 
您的Aspx代码:

<asp:Button OnClientClick="VisibledProgress()" ..../>

请尝试以下操作:

var updateProgress=document.getElementById ('<%=UpdateProgressLinkActivity.ID%>');
var updateProgress=document.getElementById(“”);

使用以下命令:

<asp:UpdateProgress value="your getting cliend id" ID="UpdateProgressLinkActivity" runat="server" AssociatedUpdatePanelID="UpdatePanelLinkActivity" DynamicLayout="True"> <ProgressTemplate> <div style=" position:absolute; top:50%; left:50%; background-color:white;" id="divLoading"> <img src="Images/loading25.gif" alt="Loading..." style="" /> </div> </ProgressTemplate> </asp:UpdateProgress>

指定value=“正在获取客户端id。”


并使用jquery--var updateProgress=$(“#UpdateProgressLinkActivity”).val()

在函数中指定上述代码,您可以在每次更新时调用该函数。实际上,元素正好为null。已使用调试器检查。不知道为什么?你检查updateProgress值。它必须等于任何id。如果id不存在,则它将显示null。最好使用updateProgressctl00\u ContentPlaceholder 1\u GridViewStories\u ctl17\u UpdateProgressLinkActivity发出警报此客户端id放在getelementbyid函数中,但仍然无法获取。我认为updateProgress客户端id的名称中没有id。您能给出id创建位置的代码吗。您好,ClientID选择值,但它是错误的。当我使用调试器检查时,clientid为ctl00\u contentplaceholder 1\u GridViewStories\u ctl17\u UpdateProgressLinkActivity,但当我在浏览器中检查id时,它是这个ctl00\u contentplaceholder 1\u GridViewStories\u ctl02\u UpdateProgressLinkActivity,这可能是嵌套UpdatePanel的问题。。我已经嵌套了两个UpdatePanel。。。我要转载。我会把链接发到你的。
<asp:UpdateProgress value="your getting cliend id" ID="UpdateProgressLinkActivity" runat="server" AssociatedUpdatePanelID="UpdatePanelLinkActivity" DynamicLayout="True"> <ProgressTemplate> <div style=" position:absolute; top:50%; left:50%; background-color:white;" id="divLoading"> <img src="Images/loading25.gif" alt="Loading..." style="" /> </div> </ProgressTemplate> </asp:UpdateProgress>