Response.Write("<a href='#?id="+getstr(dr["bt"].ToString(), 6) + "  "+ "' target='_blank'>");
只要对绑定数据进行<a href>时 绑定数据就显示不出来,要怎么样<href>呀??????
其实我只想把getstr(dr["bt"].ToString(),6)做个链接输出,可我想了很办法,没有成功!
public string getstr(string value, int size)
{
if (value.Length >= size)
{
value = value.Substring(0, size);
}
return value;
}
public void Getnr()
{
string connstring = ConfigurationManager.ConnectionStrings["net"].ConnectionString;
SqlConnection con = new SqlConnection(connstring);
con.Open();
SqlCommand cmd = new SqlCommand("select * from ldxyfocu where lei=0", con);
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
Response.Write("<a href='#?id="+getstr(dr["bt"].ToString(), 6) + "  "+ "' target='_blank'>");
}
con.Close();
}