我是从asp . net后面的代码调用Jquery函数,但它只显示一次不为其他
I am calling the Jquery function from code behind in asp net but it showing for one time only not for other
ServerMonitoringDetails objServerMonitorings = new ServerMonitoringDetails();
objServerMonitorings = ServerMonitoringBusinessManager.GetAllIpDetailsByIpAddress();
StringBuilder sbPhysicalMemory = new StringBuilder();
sbPhysicalMemory.Append("Physical Memory");
sbPhysicalMemory.Append("<div class='"MemoryFixed'">");
sbPhysicalMemory.Append("<a href='"ServerMonitoringGraphDetails.aspx?Ip=KHUSHVINDER-PC'">KHUSHVINDER-PC</a>");
ScriptManager.RegisterStartupScript(this.divPhysicalMemory, this.Page.GetType(), "script", "<script type='text/javascript'>bind(div1,50,200);</script>", false);
sbPhysicalMemory.Append("<div id='"div1'">");
sbPhysicalMemory.Append("</div>");
sbPhysicalMemory.Append("</div>");
divPhysicalMemory.InnerHtml = sbPhysicalMemory.ToString();
StringBuilder sbVirtualMemory = new StringBuilder();
sbVirtualMemory.Append("Virtual Memory");
sbVirtualMemory.Append("<div class='"MemoryFixed'">");
sbVirtualMemory.Append("<a href='"ServerMonitoringGraphDetails.aspx?Ip=KHUSHVINDER-PC'">KHUSHVINDER-PC</a>");
ScriptManager.RegisterStartupScript(this.divVirtualMemory, this.Page.GetType(), "script", "<script type='text/javascript'>bind(divVM,100,200);</script>", false);
sbVirtualMemory.Append("<div id ='"divVM'">");
sbVirtualMemory.Append("</div></div>");
divVirtualMemory.InnerHtml = sbVirtualMemory.ToString();
嗨,这是我上面的代码,我在代码后面调用相同的函数两次,但不工作
从@banana的解释中了解到它偶尔有效,@user3840910请检查
的使用情况ScriptManager。RegisterStartupScript
该方法的第三个参数应该是被注册脚本的唯一标识符。
参考:http://msdn.microsoft.com/en-us/library/bb359558(v=vs.110).aspx
也是@user3840910,这将是一个很好的做法,格式化您的脚本,而不是错过在javascript的行末分号。
相关文章:
- Array.length似乎不起作用;console.log则显示其他情况
- 如何使用幻灯片显示其他图像
- 如何将一个模态放在一边-显示其他模态(像..这样的向导)
- 动态加载的缩略图显示其他缩略图的全尺寸图像,而不是自己的缩略图(使用javascript悬停效果)
- 使用javascript中的if和else语句来显示图像(如果图像不存在,则显示其他图像)
- 悬停时:用一种颜色突出显示维基百科的所有相同链接,用不同的颜色突出显示其他地方的所有相同的链接
- 如果在带有 JavaScript 的菜单中选择了其他字段,则显示其他字段
- 如何制作隐藏/显示其他元素的滑块元素
- 如何在 MongoDB 中也聚合显示其他字段
- 隐藏元素并在浏览器窗口宽度小于时显示其他
- 关于如何根据内容高度最好地显示其他内容的建议
- 谷歌图表 饼图显示其他 100% 而不是实际值
- 需要显示其他字段的实时状态
- Dropdownlist Onchange显示其他Dropdownlist
- 复选框启用 Onload 以显示其他元素
- AngularJS-动态创建<text区域>使用ngSanitize不会't显示(其他元素显示)
- 如何使用onmouseover显示其他数据库信息
- 如何使用工具提示在气泡图中显示其他点特性
- 导航栏/菜单未使用Safari以自定义颜色显示(其他浏览器中的正确颜色)
- 如何显示其他网站的视频内容