我想把计算的一个w[]数组传递到另一个页面中,我用session写,,,大家看看错在哪里,我一直传递不过去,
protected void topsis_Click(object sender, EventArgs e)
{
Session["weight1"] =System .Convert .ToString ( w[1]);
Session["weight2"] = System.Convert.ToString(w[1]);
Session["weight3"] = System.Convert.ToString(w[1]);
Session["weight4"] = System.Convert.ToString(w[1]);
Session["weight5"] = System.Convert.ToString(w[1]);
Session["weight6"] = System.Convert.ToString(w[1]);
Response.Redirect("~/mymaster/topsis.aspx");
}
接收的部分;
double[] wei= new double[7];
protected void Page_Load(object sender, EventArgs e)
{ wei[1] = System.Convert.ToDouble(Session["weight1"]);
wei[2] = System.Convert.ToDouble(Session["weight2"]);
wei[3] = System.Convert.ToDouble(Session["weight3"]);
wei[4] = System.Convert.ToDouble(Session["weight4"]);
wei[5] = System.Convert.ToDouble(Session["weight5"]);
wei[6] = System.Convert.ToDouble(Session["weight6"]);
Session.Remove("weight1");
Session.Remove("weight2");
Session.Remove("weight3");
Session.Remove("weight4");
Session.Remove("weight5");
Session.Remove("weight6");
}
数据传递不过去,大家看看错在哪里?
protected void topsis_Click(object sender, EventArgs e)
{
Session["weight1"] =System .Convert .ToString ( w[1]);
Session["weight2"] = System.Convert.ToString(w[1]);
Session["weight3"] = System.Convert.ToString(w[1]);
Session["weight4"] = System.Convert.ToString(w[1]);
Session["weight5"] = System.Convert.ToString(w[1]);
Session["weight6"] = System.Convert.ToString(w[1]);
Response.Redirect("~/mymaster/topsis.aspx");
}
接收的部分;
double[] wei= new double[7];
protected void Page_Load(object sender, EventArgs e)
{ wei[1] = System.Convert.ToDouble(Session["weight1"]);
wei[2] = System.Convert.ToDouble(Session["weight2"]);
wei[3] = System.Convert.ToDouble(Session["weight3"]);
wei[4] = System.Convert.ToDouble(Session["weight4"]);
wei[5] = System.Convert.ToDouble(Session["weight5"]);
wei[6] = System.Convert.ToDouble(Session["weight6"]);
Session.Remove("weight1");
Session.Remove("weight2");
Session.Remove("weight3");
Session.Remove("weight4");
Session.Remove("weight5");
Session.Remove("weight6");
}
数据传递不过去,大家看看错在哪里?
解决方案 »
- 这两写法为什么一个有结果,别一个返回null呢
- .net 调用c++ dll库的路径的问题
- 100分求图片分页代码,急用
- 请问大家是如何处理Web报表的?
- 在字符串中插入字符问题!!!
- 如何控制asp.net的Session有效期?
- 如何把图片的相对路径从数据库里读取出来,变成图片
- 要命vs 2003 做第一个项目(不可恢复的生成错误) 重建N个工程试了都没有用.(救命啦,明天要出小样了)
- 关于邮件服务器SMTP的配置
- 我现在遇到2个问题.net 程序
- Anthem.NET 控件在网站发布后不能使用.
- |M| 刚想开始不ajax 但在网上看到一大堆的相关技术如:Ajax,Atlas,AjaxPro,Magicajax,AjaxPro.net怎么这么多啊.我不知道要去学什么了,请高
然后把
wei[1] = System.Convert.ToDouble(Session["weight1"]);
wei[2] = System.Convert.ToDouble(Session["weight2"]);
wei[3] = System.Convert.ToDouble(Session["weight3"]);
wei[4] = System.Convert.ToDouble(Session["weight4"]);
wei[5] = System.Convert.ToDouble(Session["weight5"]);
wei[6] = System.Convert.ToDouble(Session["weight6"]);
Session.Remove("weight1");
Session.Remove("weight2");
Session.Remove("weight3");
Session.Remove("weight4");
Session.Remove("weight5");
Session.Remove("weight6");放到
if(!IsPostBack)里
Session["weight2"] = System.Convert.ToString(w[1]);
Session["weight3"] = System.Convert.ToString(w[1]);
Session["weight4"] = System.Convert.ToString(w[1]);
Session["weight5"] = System.Convert.ToString(w[1]);
Session["weight6"] = System.Convert.ToString(w[1]);
怎么好多个w[1],是笔误还是码误?
不能禁用Cookie