ASP. NET BulletedList bind data and vs2013 Add database file

Source: Internet
Author: User

The first is to add a BulletedList control to the Web page to add the displayed data by editing the item.

This is one way to add data, and the other is to implement it by binding the data source. Before doing this, add a SQL Server database first:

Click to open the right-click menu to modify the connection

Create a table, note that for the character column, it is best to select the nvarchar type, which avoids garbled characters when inputting Chinese data.

Add some data to add some data

Add a data source to the BulletedList control.

Tick the checkbox so that you can see the connection string in the configuration file.

To continue, select the columns to display in the following steps

When you click Done, the SqlDataSource is automatically added in the page design code.

Finally run the Web site, you can see in two ways the control bulletedlist settings of the data are displayed, but why the second bulletedlist only show the contents of a field, not the corresponding URL is displayed.

This is because the DataTextField property in the control bulletedlist specifies the field that is displayed, and the DataValueField property specifies the hidden value.

Although the data is displayed, it does not appear to be clickable URLs as expected. In fact, this is very simple, just need to set a property to

, the DisplayMode property also has LinkButton and text two values, which can be handled in its Click event when the DisplayMode property is LinkButton.

ASP. NET BulletedList bind data and vs2013 Add database file

Related Article

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.