日期:2014-05-17 浏览次数:20453 次
protected void DataList1_ItemCommand(object source, DataListCommandEventArgs e) { if (e.CommandName == "look1") { Int32 id = Int32.Parse(DataList1.DataKeys[e.Item.ItemIndex].ToString());//获得当前商品编号 Response.Write("<script language='javascript'>window.open('goodslook.aspx?goodid=" + id + "');document.location=document.location;</script>"); //在新窗口中弹出商品详细信息页面 }
if (!IsPostBack) { SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["connstr"]); conn.Open(); Int32 id = Convert.ToInt32(Request.QueryString["goodsid"]); string sql = "select * from dbo.Goods where GoodsID=" + id; SqlDataAdapter sda = new SqlDataAdapter(sql, conn); DataSet ds = new DataSet(); sda.Fill(ds); this.Label1.Text = ds.Tables[0].Rows[0][3].ToString();
Int32 id = Convert.ToInt32(Request.QueryString["goodsid"]);