>>>这时其他页面上的所有控件都不能刷新let's assume you used ViewState for controls, then as long as you don't reload or rebind the controls in these 其他的所有控件, then you are fine>>>当有两个ucA控件时,其中一个已经有结果了,就更不能刷新了。when you do a submission in one of ucA 控件, try to figure out which one did the submission, then only refresh this control, not the others
在某些情况下,将状态值保存在 ViewState 中并不是最佳选择,最常用的替代方法就是会话状态,它通常更适用于:大量的数据。由于 ViewState 增加了发送到浏览器的页面的大小(HTML 有效负载),同时也增加了回传的窗体的大小,因此不适合存储大量数据。 尚未序列化到 ViewState 中的对象,如 DataSet。ViewState 序列化程序只为一小部分常用的对象类型进行了优化,如下所示。其他可序列化的类型或许可以保留在 ViewState 中,但速度会变慢,并会生成一个非常大的 ViewState。 仅支持:String、Integer、Boolean、Array、ArrayList、Hashtable 和自定义 TypeConverter
是否增加“HTML 有效负载”? 是 1。不能存储控件
2。会增加HTML 有效负载我上面说的ucA,ucB,ucC只是一个例子,实际上ucA,ucB,ucC十分复杂
我就是想知道,除了iframe 还有什么别的方法,
大家帮我想想呀
function sendKeyWord(keyWord)
{
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.4.0");
xmlhttp.open("POST","webform7.aspx",false);
xmlhttp.send("<KeyWord>"+keyWord+"</KeyWord>");
if (xmlhttp.status != 200)
alert(xmlhttp.statusText);
else
{
alert(xmlhttp.responseText);
}
}
</SCRIPT>
private void Page_Load(object sender, System.EventArgs e)
{
if(Request.InputStream.Length!=0)
{
XmlDocument xmldoc =new XmlDataDocument();
xmldoc.Load(Request.InputStream);
//其他处理
}
}
可能我的问题迷惑了大家ucA提交后会产生一定的结果,这个结果比如说使另一个ucResult控件的产生
这样我们要在同一个网页上,显示ucResult,ucB,ucC.
这样描述更好,ucB,ucC不能刷新,应为他们需要很长的时间得到。大家记住
我上面说的ucA,ucB,ucC只是一个例子,实际上ucA,ucB,ucC十分复杂
而且个数不能确定
function sendKeyWord(keyWord)
{
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.4.0");
xmlhttp.open("POST","webform7.aspx",false);
xmlhttp.send("<KeyWord>"+keyWord+"</KeyWord>");
if (xmlhttp.status != 200)
alert(xmlhttp.statusText);
else
{
alert(xmlhttp.responseText);
}
}
</SCRIPT>
<input type="text" id="txtKeyWord">
<input type="button" id="btnSearch" value="查询" onClick="javascript:sendKeyWord(document.all('txtKeyWord').value);">
ucA的后台代码中:private void Page_Load(object sender, System.EventArgs e)
{
if(Request.InputStream.Length!=0)
{
XmlDocument xmldoc =new XmlDataDocument();
xmldoc.Load(Request.InputStream);
string s=xmldoc.FirstChild.InnerText; //获得keyWord的值
//根据s的值从数据库中读取数据
//Response.Write();显示结果或者是其他操作
}
}
var xmlhttp = new ActiveXObject("MSXML2.XMLHTTP.4.0");
1.报错ie6不可建立
2.不一定要传递的一定是个form string,可能是个对象
ucA只是例子
var objXMLHTTP = new ActiveXObject("MSXML2.XMLHTTP");