Reputation: 973
I have a user control registered and placed in a aspx page.
<%@ Register TagPrefix="uc1" TagName="Client" src="/PageLayout/Client.ascx" %>
<uc1:Client id="IdClient1" runat="server"></uc1:Client>
I would like to access the id "IdClient1" in the codebehind of my user control Client. Can anybody tell how can i access it ?
Thanks
Upvotes: 1
Views: 2242
Reputation: 204
In the code behind you can access the Control ID using Me.ID
in VB or this.ID
in C#.
In VB.NET
Me.ID
In C#
this.ID
Upvotes: 4