检查你的UserControl_friend.bntSubmit_Click(Object sender, ImageClickEventArgs e)中的代码。
应该在这个文件的第2036行,看看那个变量是null的。或者把这个函数贴出来吧。
应该在这个文件的第2036行,看看那个变量是null的。或者把这个函数贴出来吧。
解决方案 »
- winfrom + webserver数据传输怎么实现
- 如何获得datagridview控件的当前值
- C#的oracle查询问题
- 在 .net 中 ComboBox 控件是不是没有只读这个属性
- 用asp.net做了一个上传和下载文件,上传是upload.aspx,下载是download,可是我没有把这两个页面连接,怎么写upload的后台代码
- 在程序运行过程中拖动和改变控件大小(兄弟些急用,谢了)
- Mono for android问题请教
- 有哪位知道哪有C#视频
- 在C#中是如何退出应用程序的,对DataSet如何负空值?谢谢!
- 如何在Window Form中显示Word文件,并且可以修改、保存?
- 有谁知道Xtreme DockingPane的用法
- 咨询:请问用C#进行网络通信编程好不好?如果要和plc通信呢,最好选用什么语言?
{
if (!Page.IsValid)
{
return;
}
if (Request.Cookies["CheckCode"] == null)
{
return;
}
if (String.Compare(Request.Cookies["CheckCode"].Value, this.txtDatabase.Value, true) != 0)
{
lblMsg.Visible = true;
lblMsg.Text = "验证码不正确!";
return;
} if (txtMap.Value.Trim() != "")
{
if (GetUploadImgs(txtMap) == null)
{
return;
}
} if (Request.QueryString["ID"] != null && Request.QueryString["ID"] != "")
{
string title = txtTitle.Value.Trim();
string self = txtDesc.Value.Trim();
string email = txtEmail.Value.Trim();
string name = txtName.Value.Trim();
string tel = txtTel.Value.Trim();
string other = txtOther.Value.Trim();
string picpath = GetUploadImgsUrl();
if (picpath != "0")
{
string[] cols = { "title", "self", "email", "name", "tel", "other", "picpath", "createtime" };
string[] values = { title, self, email, name, tel, other, picpath, DateTime.Now.ToString() };
service.UpdateFriend(cols, values, Request.QueryString["ID"]);
lblMsg.Visible = true;
lblMsg.Text = "保存成功!";
}
else
{
string[] cols = { "title", "self", "email", "name", "tel", "other", "createtime" };
string[] values = { title, self, email, name, tel, other, DateTime.Now.ToString() };
service.UpdateFriend(cols, values, Request.QueryString["ID"]);
lblMsg.Visible = true;
lblMsg.Text = "保存成功!";
}
}
else
{
Entities.friend friend = EntityFactory<Entities.friend>.CreateObject();
friend.title = txtTitle.Value.Trim();
friend.picpath = GetUploadImgsUrl();
DataTable citydt = service.FindArea(" and id=" + Request.QueryString["areaid"]).Tables[0];
friend.city = int.Parse(GetRoots(citydt, 1));
DataTable areadt = service.FindArea(" and parentid=" + GetRoots(citydt, 1)).Tables[0];
if (areadt.Rows.Count > 0)
{
friend.area = int.Parse(areadt.Rows[0]["id"].ToString()); DataTable streetdt = service.FindArea(" and parentid=" + areadt.Rows[0]["id"].ToString()).Tables[0];
if (streetdt.Rows.Count > 0)
{
friend.street = int.Parse(streetdt.Rows[0]["id"].ToString());
}
}
friend.categoryid = int.Parse(Request.QueryString["categoryid"]);
friend.createid = int.Parse(Session["Userid"].ToString() == "" ? "0" : Session["Userid"].ToString());
friend.createtime = DateTime.Now;
friend.email = txtEmail.Value.Trim();
friend.name = txtName.Value.Trim();
friend.other = txtOther.Value.Trim();
friend.self = txtDesc.Value.Trim();
friend.tel = txtTel.Value.Trim();
service.InsertFriend(friend); lblMsg.Visible = true;
lblMsg.Text = "保存成功!";
}
}
或上服务器 运行,就能报出错误在哪里