ASP.NET Listbox Client Side changes not reflected on page
- From: chandru <chandru.technology@xxxxxxxxxxxxxx>
- Date: Fri, 20 Jul 2007 06:58:58 -0700
Hi,
I am adding some values to the ASP.NET ListControl on the client side
javascript
and this is not reflecting on the server side.
I thought the input and select fields should reflect the changes on
the server side.
I know that the post backs doesn't post all of the HTML only the
changes etc,etc.
I am adding so many values to the list on the client side so I can't
have an hidden input field.
That will make things complex.
Any ideas?
Below is the javascript code,
function OnClientClick_btnAdd()
{
var listReomveFrom = document.getElementById("ctl00$MainContent
$ListBoxAvailable");
var listAddTo= document.getElementById("ctl00$MainContent
$ListBoxSelected");
var iCurrentIndex = listReomveFrom.selectedIndex;
var iNewOptionIndex = listAddTo.length;
if (iCurrentIndex != -1)
{
listAddTo.options[iNewOptionIndex] = new Option();
listAddTo.options[iNewOptionIndex].text =
listReomveFrom.options[iCurrentIndex].text;
listAddTo.options[iNewOptionIndex].value =
listReomveFrom.options[iCurrentIndex].value;
listAddTo.options[iNewOptionIndex].selected =
listReomveFrom.options[iCurrentIndex].selected;
listReomveFrom.options[iCurrentIndex --] = null;
}
}
Thanks,
Chandrasekar Balasubramaniam
.
- Follow-Ups:
- Re: ASP.NET Listbox Client Side changes not reflected on page
- From: bruce barker
- Re: ASP.NET Listbox Client Side changes not reflected on page
- Prev by Date: Re: ASP.NET Master Page & Dynamic Page Title
- Next by Date: Re: DropDownList and DataSet. Where is my error?
- Previous by thread: ASP.NET Master Page & Dynamic Page Title
- Next by thread: Re: ASP.NET Listbox Client Side changes not reflected on page
- Index(es):
Relevant Pages
|