我想从后面的代码中动态创建像这样或这样的自定义工具提示,这就是我到目前为止所得到的。
public void printSubjects()
{
SqlConnection con = new System.Data.SqlClient.SqlConnection();
con.ConnectionString = ConfigurationManager.ConnectionStrings["beta"].ConnectionString;
SqlDataAdapter da = new SqlDataAdapter("select SUBJECT_ID,X_COOR,Y_COOR from M_SUBJECT WHERE TERRITORY_ID =" + Convert.ToInt32(ddMaps.SelectedItem.Value) + " AND X_COOR !='" + 0 + "'", con);
DataSet ds = new DataSet();
da.Fill(ds, "SubjectLinked");
points = new Button[ds.Tables[0].Rows.Count];
for (int i = 0; i < ds.Tables[0].Rows.Count; i++ )
{
points[i] = new Button();
points[i].CssClass = "fixPoint";
points[i].Style.Add("top", ds.Tables[0].Rows[i]["Y_COOR"].ToString() + "px");
points[i].Style.Add("left", ds.Tables[0].Rows[i]["X_COOR"].ToString() + "px");
SqlDataAdapter daII = new SqlDataAdapter("select USER_NAME from I_SUBJECT WHERE ID =" + Convert.ToInt32(ds.Tables[0].Rows[i]["SUBJECT_ID"].ToString()) + "", con);
DataSet dsII = new DataSet();
daII.Fill(dsII, "SubjectName");
points[i].ToolTip = dsII.Tables[0].Rows[0]["USER_NAME"].ToString();
points[i].Click += new EventHandler(deleteLink_Click);
myID.Controls.Add(points[i]);
}
}
这就是结果
如何实现 jquery qtip 或 ajax 悬停菜单或其他任何东西,以便在代码后面的每个工具提示中添加主题图像和其他主题信息..?