- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果容器页面上的 UC 设置为 Visible false,我正在考虑停止页面加载的执行。现在我遵循以下逻辑
public class TestControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (this.Visible)
{
//do heavy operation
}
}
}
即我会检查该控件在UC的页面加载中是否可见,如果为true,则只在那里进行操作。还有其他更好的方法吗?我的申请中有很多 UC。如果Visible false,是否有一些通用逻辑来停止UC页面加载的执行。
最佳答案
Control 类的 Visible
属性仅确定是否呈现 Control,但它对控件生命周期的其余部分没有影响。
来自MSDN :
If this property is false, the server control is not rendered. You should take this into account when organizing the layout of your page. If a container control is not rendered, any controls that it contains will not be rendered even if you set the Visible property of an individual control to true. [...]
这是有道理的,因为这样您就可以拥有仍然执行特定操作的不可见控件。您也可以通过不向其中放入任何内容来做到这一点,但它们可能仍然会呈现一些空格或换行符。将 Visible
设置为 false 是最简洁的方法。
如果控件不可见,我认为没有更好的方法来阻止代码的执行,但我认为您的解决方案足够干净。
作为替代方案,您可以将代码放入 OnPreRender 事件中,该事件仅在控件可见时触发。但请记住,这是 Control Lifecycle 中的后续步骤。 .
public class TestControl : System.Web.UI.UserControl
{
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
// Your code here
}
}
关于.net - 如何在 Visible false 的页面加载时停止 UC 的执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7371417/
我有这个 UC: this.show = function() { ... var myvar = "Text of the var." this.Property1 = m
在浏览 unicode 文档时,我有时会看到术语 UTF-16 可与 UCS-2 互换使用,也可与 UTF-32 和 UCS-4 互换使用。我想知道 UTF-8 是否也有一个很酷的昵称,比如 UCS-
我有 50% 的流量来自 UC 浏览器。在新版本的 UC 浏览器中看不到谷歌广告,那么我如何从我的网站获得良好的收入? 我过去 7 天使用过 UC Union 广告网络,但它产生了 0 美元的收入。我
ucs-4字符'🤣'的unicode值为0001f923,复制到java代码中时会自动更改为\uD83E\uDD23对应的值在 IntelliJ IDEA 中。 Java仅支持ucs-2,因此发生了
正如标题所说的那样。 $ ./configure --help | grep -i ucs --enable-unicode[=ucs[24]] 查了官方文档,发现是这样的: sys.maxuni
只要我没记错,UCS 和 BFS 是一样的,唯一的区别是它不是扩展最浅的节点,而是扩展路径成本最低的节点。 (也为此使用 PriorityQueue 而不是 Queue)所以我复制了我的 BFS 代码
我正在尝试编译/构建我的项目,但我在下面收到此错误: [dcc32 fatal error ] 不支持 F2438 UCS-4 文本编码。转换为 UCS-2 或 UTF-8 IDE 没有显示我需要转换
下面是一个简单的标记。谁能帮我写一个脚本,该脚本仅在 uc mini 浏览器中显示带有“信息框”类的 div。它应该隐藏在浏览器的其余部分。 UC Mini .info-box { d
最近几天我一直被这个问题困扰,我有一个使用 Angular 构建的单页应用程序网站。 我在网站的一个部分实现了 div 的水平滚动(旋转木马类型 View ),在其他浏览器上运行良好。 然而,在 UC
我已经安装了来自 Entrust 的 UC 多域 SSL 证书,用于两个 OpenCart 安装和一个公司域,所有这些都托管在同一 IP。 我的证书上有 3 个域,顺序如下 www.example.c
我目前正在处理的项目需要与我们不制作的客户端系统交互,因此我们无法控制数据的发送方式。问题是在 C# 中工作,它似乎对 UCS-2 没有任何支持,对 big-endian 的支持也很少。 (据我所知)
我试图在我的 42 个字符密码中随机获取小写/大写。不知何故我反而得到: ucclcjuczlclucmlc0lcdlc5lc0ucdlccucmucquc5ucslc4lckucxuctlcvlcq
我正在尝试构建此 UI,因为浏览器屏幕长时间停留在一个部分并且无法在网络上找到任何相关主题。我想实现作为对话框弹出的 UC 浏览器设置/汉堡菜单。我如何开始这件事 images link contai
这是我的代码: ` .column1{ width:calc(100% - 100px); float:left; } .column2{ width:100px; float:left; } `
我的问题是特定于浏览器的。我的 css 在移动设备上的 UC 浏览器中无法像在其他浏览器中一样正常工作。 我想将占位符垂直居中对齐。但令我惊讶的是,垂直对齐似乎有点偏离。 这是我从UC浏览器截取的截图
我有一个文本文件,它是使用某些 Microsoft 报告工具创建的。文本文件在开头包含 BOM 0xFFFE,然后是 ASCII 字符输出,字符之间有空值(即“F.i.e.l.d.1.”)。我可以使用
我想在 Go 中翻译我的 python 程序,将 unicode 字符串转换为 UCS-2 HEX 字符串。 在 python 中,这很简单: u"Bien joué".encode('utf-16-
虽然researching options用于在可能很大的SQL Server数据库中存储大多数英语但有时不是的数据,但我倾向于将大多数字符串数据存储为UTF-8编码。 但是,Microsoft之所以
我在我的项目中使用 ATMEGA128 微 Controller 和 AVR studio。我正在使用接收中断 ISR_USART0 来接收 8 个字节的数据作为数据包,并且在完成接收数据后调用该中断
我已经制作了这个脚本,但我有一个问题: $(document).ready(function() { $('html').html(function(i, v) { var searchM
我是一名优秀的程序员,十分优秀!