Hi,
> I have three dropdownlists in an AJAX UpdatePanel and I need to return the
> selected index for two of them; the problem is that I'm only able to return
[quoted text clipped - 15 lines]
> Why won't it find the dropdownlists for the two that I need to return the
> SelectedIndex from?
The unique name for the client, aka ClientId is generated by the server.
You must make sure that 'ct100$ContentPlaceHolder1$ddlEntityGroups' and
the other are really named this way. To make this sure, view the HTML
source on the web client. In your server-side code, use the control's
ClientId to generate the JavaScript code to get it.
HTH,
Laurent

Signature
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Mark Rae [MVP] - 01 Aug 2007 18:43 GMT
>> var entityTypeIndex =
>> document.getElementById('ct100$ContentPlaceHolder1$ddlEntityType').selectedIndex;
[quoted text clipped - 5 lines]
>> document.getElementById('ct100$ContentPlaceHolder1$ddlProcesses').selectedIndex;
>> // this doesn't work
var entityTypeIndex =
document.getElementById('<%=ddlEntityType.ClientID%>').selectedIndex;
var entityGroupIndex =
document.getElementById('<%=ddlEntityGroups.ClientID%>').selectedIndex;
var processesIndex =
document.getElementById('<%=ddlProcesses.ClientID%>').selectedIndex;

Signature
Mark Rae
ASP.NET MVP
http://www.markrae.net
AlBruAn - 01 Aug 2007 19:18 GMT
Thanks for the tip. I'd inadvertently typed the number "1" rather than the
letter "l"; I thought I'd copied and pasted it, but apparently not.
> Hi,
>
[quoted text clipped - 26 lines]
> HTH,
> Laurent
Laurent Bugnion, MVP - 01 Aug 2007 23:01 GMT
Hi,
> Thanks for the tip. I'd inadvertently typed the number "1" rather than the
> letter "l"; I thought I'd copied and pasted it, but apparently not.
That's why you shouldn't. You should use ClientID instead. This way, if
the containing control's name changes, you don't need to change your code.
HTH,
Laurent

Signature
Laurent Bugnion [MVP ASP.NET]
Software engineering, Blog: http://www.galasoft.ch
PhotoAlbum: http://www.galasoft.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch