标签:http os io ar cti html amp new
Source file
SqlConnection strcon = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["strcon"]); strcon.Open(); SqlDataAdapter sda = new SqlDataAdapter("select a.*,b.companyname from tb_stock a left join tb_company b on a.companyid=b.id where type=‘" + type + "‘ and jz=0", strcon); DataSet ds=new DataSet(); sda.Fill(ds, "Reckoning"); GridView1.DataSource = ds.Tables["Reckoning"]; GridView1.DataKeyNames = new string[]{"id"}; GridView1.DataBind(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; this.bind(); } protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e) { string id = GridView1.DataKeys[e.NewSelectedIndex].Value.ToString() ; Response.Write("<script>window.open(‘open.aspx?id=" + id + "&type=" + Request["type"] + "&je=" + GridView1.Rows[e.NewSelectedIndex].Cells[3].Text + "&com="+GridView1.Rows[e.NewSelectedIndex].Cells[1].Text+"‘,‘‘,‘width=380,height=200,scrollbars=no‘)</script>"); } protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType==DataControlRowType.DataRow) { if ((e.Row.Cells[1].Text).Length > 6) { e.Row.Cells[1].Text = (e.Row.Cells[1].Text).Substring(0, 6) + "…"; } if ((e.Row.Cells[2].Text).Length > 6) { e.Row.Cells[2].Text = (e.Row.Cells[2].Text).Substring(0, 6) + "…"; }
标签:http os io ar cti html amp new
原文地址:http://www.cnblogs.com/wipphj/p/3891695.html