c# - 如何禁用 C# 中的 div 代码?

标签 c# javascript jquery asp.net ajax

我有一个 div,我通过 Page.ClientScript.RegisterStartupScript 从代码后面调用它 另一个 div 位于此 div 中,带有 style="display: none;是否可以在后台调用主div时启用第二个div?

这是我的代码- Page.ClientScript.RegisterStartupScript(this.GetType(), "OpenNewWindow", "<script type='text/javascript'>$(function() { $('#MainDiv').dialog('open'); })</script>");

最佳答案

put these attributes in div runat="server"  and an id="a_name"
Declare Your div like following

<div runat="server" id="dv">
your contents
</div>

call the dv from Code behind and then do with that dv whatever you want 

关于c# - 如何禁用 C# 中的 div 代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17629511/

相关文章:

c# - REST 服务代理与 WCF SOAP 代理的性能对比

c# - WPF:为什么我应该使用现有的 MVVM 框架而不是编写自己的框架?

javascript - 在 javascript 中使列名动态化

c# - MVC3,从列表中获取更新的表单数据

c# - move 玩家然后改变场景

javascript - Google 电子表格侧边栏中的表单处理和验证

javascript - Grunt 不适用于自动引用 css 和 js

javascript - 使用 yep/nope 和 document.ready

jQuery 查找子复选框

php - Get - Request ,在 Alert() 中显示结果