Try the following:
Dim j As String = "Your text and value"
Dim opt As New ListItem(j)
Me.DropDownList1.Items.Add(opt)
This technique will automatically set the Text and Value properties to the
same value. If you prefer, you can set the Text and Value properties using
one of the following techniques instead:
Dim opt As New ListItem()
opt.Text = "Your text"
opt.Value = "Your value"
Dim opt As New ListItem("Your text", "Your value")
Good Luck!
--
Nathan Sokalski
nj********@hotmail.com http://www.nathansokalski.com/
"Garg" <sh**********@gmail.comwrote in message
news:11**********************@q2g2000cwa.googlegro ups.com...
Please tellme how do I write vb.net code for the following code:
var opt = document.createElement("option");
opt.text = j;
opt.value = j;
document.all(elementname).options.add(opt);