ASP.Net – Add a default value to a binded dropdown list

Hello, today you will learn how to add a default value such as “select a value” to the top of your bound dropdown list in vb.net. I am not going to show you how to bind your dropdown list, you can do that by searching this in google if you do not know how to do this.

After your dropdown list has been bound, you should use the following code after you close your connection to the database.

Dim Item As ListItem = New ListItem Item.Text = “select a value” Item.Value = “0″ Item.Selected = True BoundDropDownList.Items.Insert(0, Item)

Hope this helps.

... Read More

HTML Lists

So you want to learn how to create HTML Lists? That’s why you are here right?

Here is a list of HTML list tags you can use.

<ol> Defines an ordered list <ul> Defines an unordered list <li> Defines a list item <dl> Defines a definition list <dt> Defines a term (an item) in a definition list <dd> Defines a description of a term in a definition list <dir> Deprecated. Use <ul> instead <menu> Deprecated. Use <ul> instead

Here is an example of an unordered list.

An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.

<ul> <li>Hockey</li> <li>Football</li> </ul>

Result

Hockey Football

<ol> <li>Hockey</li> <li>Football</li> </ol>

Result

Hockey Football

Experiment with the other tags to see what you get. Good luck.

... Read More