Findind the Ids of UserControl frpm aspx page code behind

Posted by Sandhyab under ASP.NET category on | Points: 40 | Views : 690
For Textbox:
TextBox txtname= (TextBox)UserControl1.FindControl("txtFirstName");

For DropDOwnList:
DropDownList dlState = (DropDownList)UserControl1.FindControl("ddlStates");

UserControl1 is the Id of the usercontrol which is used in aspx page

Comments or Responses

Login to post response