Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get an ASP.NET control's auto generated name attribute?

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?

like image 780
Petras Avatar asked Apr 15 '10 06:04

Petras


1 Answers

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

like image 115
wRAR Avatar answered Sep 20 '22 10:09

wRAR