The first is a prompt box similar to google's results
It is easy to use. Drag the control onto the page and set properties.
ColumnTextIndex indicates the column number of the displayed text, ColumnValuendex indicates the column number of the Value, and ShowHeader indicates whether to display the header
Then implement Search events
The background instance code is as follows:
-
C # code
-
protected object AjaxTextBox1_Search(object sender, HampWebControl.AjaxTextBox.SearchEventArgs e) { String connStr = @"server=PC-200902201516\SQLEXPRESS;database=IPSystem;uid=sa;pwd=123456"; String sql = "select id,name from person where name like '%"+e.Text.Trim()+"%'"; using (SqlConnection conn = new SqlConnection(connStr)) { conn.Open(); SqlCommand sd = new SqlCommand(sql, conn); SqlDataAdapter sa = new SqlDataAdapter(sd); DataTable dt = new DataTable(); sa.Fill(dt); return dt; } }
You can use e. Text to obtain the input values on the page, and then return the results to be processed, such as DataTable, DataSet, SqlDataReader, and IList.
The second is to use DIV to display ToolTip
Usage:
Drag it up and set properties
FollowMouse: indicates whether the ToolTip follows the mouse
RelativeX: distance from the X axis of the mouse
RelativeY: distance from the Y axis of the mouse
Text: The Text displayed in it. You can write HTML code.
TipLocation: the position where the image appears, which is in the upper left corner, in the upper right corner, in the lower left corner, and in the lower right corner.
TipStyle: style, yellow, green, blue, custom four
ControlToTip: name of the control bound to the ToolTip. If it is an HTML control, you can write an ID directly in the attribute bar. If it is a server control, you must write code in the background.
-
C # code
-
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { HampToolTip1.ControlToTip = Label1.ClientID; } }
That's easy !!
Control download