P
Pai
Hello there,
In a .aspx page I have a HTML Select Control... a listbox and a aspx
server control a button.
using javascript I add items into it the list box as follows:
var myNewOption = new Option("test1","test1");
document.Form1.Select2.options[0] = myNewOption;
var myNewOption = new Option("test2","test2");
document.Form1.Select2.options[1] = myNewOption;
now when i click on the aspx server control the button, i need to get
the count of the number of options in the listbox.
I use the following code in the code behind section of my .aspx page.
private void btnCreateSite_Click(object sender, System.EventArgs e)
{
Response.Write ("Count:"+Select2.Items.Count);
}
but the count is always zero....
how do i get the count for the number of the list items and the value
of the items whcih I have populated in the listbox using javascript in
my code behind.
Any suggestion or help....
Kind Regards,
Srikanth Pai
In a .aspx page I have a HTML Select Control... a listbox and a aspx
server control a button.
using javascript I add items into it the list box as follows:
var myNewOption = new Option("test1","test1");
document.Form1.Select2.options[0] = myNewOption;
var myNewOption = new Option("test2","test2");
document.Form1.Select2.options[1] = myNewOption;
now when i click on the aspx server control the button, i need to get
the count of the number of options in the listbox.
I use the following code in the code behind section of my .aspx page.
private void btnCreateSite_Click(object sender, System.EventArgs e)
{
Response.Write ("Count:"+Select2.Items.Count);
}
but the count is always zero....
how do i get the count for the number of the list items and the value
of the items whcih I have populated in the listbox using javascript in
my code behind.
Any suggestion or help....
Kind Regards,
Srikanth Pai