ispostback不同的环境,值也不同,求解 我不知道你要判断属性是做什么的,我觉得像下面这么写就不会有啥问题 if (!IsPostBack) { // bind(); } 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 没有人碰到过吗?A页面里 有 服务器text控件,输入值,用js提交form 到 B页面 B页面load事件里 判断 IsPostBack 本来 IsPostBack 应该为 false ,结果 在 win8 下面 却是 true有喜欢研究的同学 可以试验一下 form 设 method = post 就值都一样了 我把试验的代码贴一下:B.aspx 页面-------------------------<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="B.aspx.cs" Inherits="PromotionManage.Promotion.B" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>无标题页</title> <script type="text/javascript"> function f() { form1.action = "B2.aspx"; form1.method = "post"; form1.submit(); } </script></head><body> <form id="form1" runat="server" method="post"> <div> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <input type="button" value="提交" onclick="f();" /></div> </form></body></html>------------------------------------B2.aspx 后台代码protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { this.Response.Write("第一次加载"); } else { this.Response.Write("回发"); } }-------------------------大家有用win8的 可以试验一下 在 win8系统里 用 2.0 netframenwork 测试结果 :回发在 win8系统里 用 4.0 netframenwork 测试结果 :第一次加载 在win server2003 用 2.0 netframenwork 测试结果 :第一次加载 不知何解? jQuery .ajax 方法怎么获得后台方法返回值 Asp.net能够控制远程页面进行提交操作吗? 关于IIS的问题大家快点来帮忙啊``` 可否将infopath嵌入到asp.net页面? 遍历树问题,想了很久没有结果,还请高人进来指点迷经!!!!!!! 怎么用ASP.NET实现图片处理? 好像水平高的.net程序员很少? asp.net 验证控件 问题 VS总调试存储过程的问题?/ Release 编译问题—— 大侠帮分析,AutoCompleteExtender控件在这种情况下为什么不起作用 js 怎么加密字符串 <html>
A页面里 有 服务器text控件,输入值,用js提交form 到 B页面 B页面load事件里 判断 IsPostBack 本来 IsPostBack 应该为 false ,结果 在 win8 下面 却是 true有喜欢研究的同学 可以试验一下
B.aspx 页面
-------------------------<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="B.aspx.cs" Inherits="PromotionManage.Promotion.B" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function f()
{
form1.action = "B2.aspx";
form1.method = "post";
form1.submit();
}
</script>
</head>
<body>
<form id="form1" runat="server" method="post">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<input type="button" value="提交" onclick="f();" /></div>
</form>
</body>
</html>------------------------------------
B2.aspx 后台代码protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.Response.Write("第一次加载");
}
else
{
this.Response.Write("回发");
}
}
-------------------------
大家有用win8的 可以试验一下
在 win8系统里 用 2.0 netframenwork 测试结果 :回发
在 win8系统里 用 4.0 netframenwork 测试结果 :第一次加载
在win server2003 用 2.0 netframenwork 测试结果 :第一次加载 不知何解?