刚学asp的,这个是留言板的一个页面,获取留言者id的功能,不知道哪里有错,请指教
protected void replyButton_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(Request.QueryString["CommandArgument"]);
string id = Request.QueryString["Id"];
Response.Write(id.ToString());
//string strreply = this.replyBox.Text;
//SqlConnection con = dbconn.connection();
//con.Open();
//string query = "update userInfo set reply='" + strreply + "' where Id=";
//string queryid = query + "'" + id + "'";
//SqlCommand cmd = new SqlCommand(queryid, con);
//if ((cmd.ExecuteNonQuery()) > 0)
//{ // Response.Redirect("~/Default.aspx");
//}
//else
//{
// Response.Write("您的回复失败"); //}
//con.Close(); }
}
protected void replyButton_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(Request.QueryString["CommandArgument"]);
string id = Request.QueryString["Id"];
Response.Write(id.ToString());
//string strreply = this.replyBox.Text;
//SqlConnection con = dbconn.connection();
//con.Open();
//string query = "update userInfo set reply='" + strreply + "' where Id=";
//string queryid = query + "'" + id + "'";
//SqlCommand cmd = new SqlCommand(queryid, con);
//if ((cmd.ExecuteNonQuery()) > 0)
//{ // Response.Redirect("~/Default.aspx");
//}
//else
//{
// Response.Write("您的回复失败"); //}
//con.Close(); }
}
解决方案 »
- asp.net 导出(下载)Excel xp、win7 兼容
- 请问各位大牛,mvc 3如何实现传一个文件地址到Controller下载该文件,谢谢
- 主题:项目在vs2005下运行正常,在iis下运行出错怎样解决,请大家邦忙.
- vs2003经常连接不上数据库,什么原因?
- NHibernate开发
- treeview单击事件
- 谁能发个菜单控件给我(aspnetmenu或其他好用的)!
- sql语句中时间的比较!!!!!!!!!!!
- 用什么orm快速,方便,简洁,又容易上手?
- 请问.net下如何实现无扩展名的url重写技术
- asp.net三层架构的一个问题?
- cmd.ExecuteScalar()异常(紧急!!)
protected void replyButton_Click(object sender, EventArgs e)
{
int id = Convert.ToInt32(Request.QueryString["CommandArgument"]);
//string id = Request.QueryString["Id"];
Response.Write(id.ToString());
//string strreply = this.replyBox.Text;
//SqlConnection con = dbconn.connection();
//con.Open();
//string query = "update userInfo set reply='" + strreply + "' where Id=";
//string queryid = query + "'" + id + "'";
//SqlCommand cmd = new SqlCommand(queryid, con);
//if ((cmd.ExecuteNonQuery()) > 0)
//{ // Response.Redirect("~/Default.aspx");
//}
//else
//{
// Response.Write("您的回复失败"); //}
//con.Close(); }
}
看跳转时是否有传CommandArgument这个参数过来