views:

122

answers:

1

I have a DropDownList and need to know its name in the code behind:

<select name="ctl00$cphMainContent$ddlTopic" onchange="javascript:setTimeout('__doPostBack(\'ctl00$cphMainContent$ddlTopic\',\'\')', 0)" id="ctl00_cphMainContent_ddlTopic">
<option value="All">All</option>
</select>

I need to get the value "ctl00$cphMainContent$ddlTopic"

Is that possible?

+6  A: 

myddl.ClientID / myddl.UniqueID, depending on what you need, name or id attribute.

wRAR
Just a note, ClientID/UniqueID are only available from PreRender onwards.
Dean Harding