The two Web controls made by ASP. NET are shared with you.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.