---
title: "ControlID is not recognized in code behind"  
description: "ControlID is not recognized in code behind"  
author: "Anonymous User"  
published: 2014-09-29  
updated: 2014-09-29  
canonical: https://www.mindstick.com/forum/2280/controlid-is-not-recognized-in-code-behind  
category: "asp.net"  
tags: ["asp.net"]  
reading_time: 1 minute  

---

# ControlID is not recognized in code behind

This is my [asp](https://www.mindstick.com/articles/751/introduction-to-asp-dot-net-mvc) code

```
<tr class="footer" runat="server">    <td colspan="4" runat="server">* By WWW.Play.org      
<asp:DropDownList AutoPostBack="true"
runat="server" ID="callDispositionSelector"
OnSelectedIndexChanged="callDispositionChanged">          
<asp:ListItem Value="-1">Select Disposition Reason</asp:ListItem>           <asp:ListItem Value="1">Reservation</asp:ListItem>          
<asp:ListItem Value="2">Change of Reservation</asp:ListItem>          
<asp:ListItem Value="3">Cancellation</asp:ListItem>          
<asp:ListItem Value="4">Wait List</asp:ListItem>           <asp:ListItem Value="5">Other</asp:ListItem>      
</asp:DropDownList>    </td></tr>
```

In [code behind](https://www.mindstick.com/forum/2199/call-javascript-s-function-from-code-behind), I am not able to type this callDispositionSelector. In other words, [visual studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) doesn't recognize that id.

## Replies

### Reply by Sumit Kesarwani

Hi tanuj, \
try this:\

protected void lst_ItemDataBound(object sender, ListViewItemEventArgs e)

{

if (e.Item.ItemType == ListViewItemType.DataItem)

{

DropDownList ddl= (DropDownList)e.Item.FindControl("callDispositionSelector");

}

}


---

Original Source: https://www.mindstick.com/forum/2280/controlid-is-not-recognized-in-code-behind

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
