Hi!
I have a asp.net control combo box. I want to pouplate it with the name of the months.
I am wring the code in the code behind. I am using vb.net as the code behind.
My code is
I get the populated month names in the combobox, because of the function month name.Code:'Month dim i as integer dim myvar as string i = 1 Do While i <= 12 myvar = MonthName(i, True) cboMonth.Items.Add(myvar) i = i + 1 Loop
But in the value I want 1,2,3 not Jan, Feb, Mar...How to achive this.
Had been it ASP I wud have written:
This wud have given me the dsired result.Code:do while iLoop <= 12 myvar = MonthName(iLoop,true) Response.Write "<option value=" & iLoop & " selected>" & myvar & "</option>" iLoop = i Loop+1 loop
How to do in VB.NET?




Reply With Quote