Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Label
ASP.NET
<asp:Label ID="lblHasIncompleteTaskNTodo" runat="server" Text="!Task/Parent-Task has Incomplete To-Do's" ForeColor="Red" Visible="false"></asp:Label>

in aspx page ,

I want to use access in ascx page how can I do that ?
Posted
Updated 21-Oct-13 5:04am
v2
Comments
Ali_100 21-Oct-13 11:03am    
I am getting many example of vice versa ,but i need to access a label control to be visible on aspx page from user control condition.

1 solution

inside your aspx page try using the FindControl method, but make sure your ascx control is loaded before calling this method.

Label label = (Label)Page.FindControl("lblHasIncompleteTaskNTodo");

http://msdn.microsoft.com/en-us/library/31hxzsdw.aspx[^]
 
Share this answer
 
Comments
Ranjan.D 21-Oct-13 17:41pm    
Perfect, It should work!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900