Click here to Skip to main content
11,431,483 members (65,916 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET DataBinding
Hello dear all.

i have a user control in which is called ucPostList and it contains a DataList control . in my DataList control i have another user control which is called ucOpinion. both two control retrive data from database and fill their source controls. now if i want to fill ucPostList by call their method ucOpinion control doesn't fill their source control .
how i can call internal control method ?
i want to call ucOpinion control method in ucPostList control . but i can not find any ucOpinion by
Posted 11-Mar-12 2:58am
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

I hope ajit has given the solution for your problem. If you still want to improve or looking for another solution its here-
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Hi ,

First Register The User Control By Adding This Code On aspx Page :

<%@ Register Src="~/WebUserControls/ucPostList.ascx" TagName="ucPostList" TagPrefix="ucPostList" %>

Secondly Create a Object in Cs Page and find the Control :

ucPostList objPostList;
objPostList= (ucPostList)this.Page.FindControl("ucPostList");

After Creating the Object you can Call any functions Or Methods from your User Control.

Hope This May Help You.

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

Advertise | Privacy | Mobile
Web02 | 2.8.150428.2 | Last Updated 28 Mar 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100