ajax.dll 使用问题
我使用下面方法返回一个字符串路径本机测试完全正常,发布服务器上检测接收的返回值为null不懂怎么回事~~并且其他类似的ajax函数在服务器上也都正常[Ajax.AjaxM...
我使用下面方法返回一个字符串路径 本机测试完全正常,发布服务器上检测接收的返回值为null 不懂怎么回事~~ 并且其他类似的ajax函数在服务器上也都正常
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public string SubmitPic(string i, string strPicFile)
{
FileStream fs = new FileStream(strPicFile, FileMode.Open);
byte[] bpic = new byte[fs.Length];
fs.Read(bpic, 0, int.Parse(fs.Length.ToString()));
fs.Close();
ArrayList arrayPicInfo = new ArrayList();
ZHYZ_Medical.Model.PicInfo modelPicInfo = null;
if (HttpContext.Current.Session["arrayPicInfo"] != null)
{
arrayPicInfo = HttpContext.Current.Session["arrayPicInfo"] as ArrayList;
}
else
{
modelPicInfo = new ZHYZ_Medical.Model.PicInfo();
modelPicInfo.FIPicture = bpic;
arrayPicInfo.Add(modelPicInfo);
}
if (int.Parse(i) > arrayPicInfo.Count)
{
modelPicInfo = new ZHYZ_Medical.Model.PicInfo();
modelPicInfo.FIPicture = bpic;
arrayPicInfo.Add(modelPicInfo);
}
else
{
modelPicInfo = arrayPicInfo[int.Parse(i) - 1] as ZHYZ_Medical.Model.PicInfo;
modelPicInfo.FIPicture = bpic;
arrayPicInfo[int.Parse(i) - 1] = modelPicInfo;
}
HttpContext.Current.Session["arrayPicInfo"] = arrayPicInfo;
return "readimage.aspx?picid=" + i;
} 展开
[Ajax.AjaxMethod(Ajax.HttpSessionStateRequirement.ReadWrite)]
public string SubmitPic(string i, string strPicFile)
{
FileStream fs = new FileStream(strPicFile, FileMode.Open);
byte[] bpic = new byte[fs.Length];
fs.Read(bpic, 0, int.Parse(fs.Length.ToString()));
fs.Close();
ArrayList arrayPicInfo = new ArrayList();
ZHYZ_Medical.Model.PicInfo modelPicInfo = null;
if (HttpContext.Current.Session["arrayPicInfo"] != null)
{
arrayPicInfo = HttpContext.Current.Session["arrayPicInfo"] as ArrayList;
}
else
{
modelPicInfo = new ZHYZ_Medical.Model.PicInfo();
modelPicInfo.FIPicture = bpic;
arrayPicInfo.Add(modelPicInfo);
}
if (int.Parse(i) > arrayPicInfo.Count)
{
modelPicInfo = new ZHYZ_Medical.Model.PicInfo();
modelPicInfo.FIPicture = bpic;
arrayPicInfo.Add(modelPicInfo);
}
else
{
modelPicInfo = arrayPicInfo[int.Parse(i) - 1] as ZHYZ_Medical.Model.PicInfo;
modelPicInfo.FIPicture = bpic;
arrayPicInfo[int.Parse(i) - 1] = modelPicInfo;
}
HttpContext.Current.Session["arrayPicInfo"] = arrayPicInfo;
return "readimage.aspx?picid=" + i;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询