本文介绍了ScriptManager.RegisterHiddenField在Chrome的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与一些code,它利用ScriptManager.RegisterHiddenField跟踪修改一个数据模型的工作。它工作在IE和FF罚款,但Chrome在麻烦。如果你添加类似发生问题的一个简单的例子:

I'm working with some code that utilizes the ScriptManager.RegisterHiddenField to keep track of modifications to a datamodel. It works fine in IE and FF, but Chrome is having trouble. A simple example of the problem occurs if you add something like:

protected void Page_Load(object sender, EventArgs e)
{
    ScriptManager.RegisterHiddenField(this, DateTime.Now.ToString(), "keith");
}

在页面上。当你第一次加载它正常的页面,你会看到这样一个隐藏字段:

on a page. When you first load the page it works correctly, you will see a hidden field like:

<input type="hidden" name="12/17/2010 9:55:13 AM" id="12/17/2010 9:55:13 AM" value="keith" />

然而,如果你做任何事情需要一个回也不会为隐藏字段的名称生成一个新的日期/时间。它通常产生之前从小时领域的缓存版本。为什么Chrome的执行这种方式与RegisterHiddenField有什么想法?感谢您的任何帮助。

However, if you do anything that requires a post back it will not generate a new date/time for the name of the hidden field. It usually generates a cached version of the field from hours before. Any thoughts on why Chrome performs this way with RegisterHiddenField? Thank you for any help.

基思

推荐答案

Chrome的实际缓存查看源文件。

Chrome is actually caching the "view source".

如果你在,你会看到类似查看源代码:HTTP://本地主机:51966 / Default.aspx的网址看看

If you look in the url you will see something like "view-source:http://localhost:51966/Default.aspx"

点击刷新按钮,你会看到你的隐藏字段的变化。

Hit the refresh button and you will see your hidden field change.

这篇关于ScriptManager.RegisterHiddenField在Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 21:09