Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET DataBinding
Hello dear all.
 
i have a user control in asp.net which is called ucPostList and it contains a Asp.net 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
ucPostList.FindControl("ucOpinion1")
Posted 11-Mar-12 1:58am
Rate this: bad
good
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- http://www.blog.dapfor.com/data-binding
  Permalink  
Rate this: bad
good
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.
objPostList.myFunction()
 

Hope This May Help You.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 853
1 OriginalGriff 410
2 CPallini 275
3 George Jonsson 226
4 Richard Deeming 145
0 OriginalGriff 5,450
1 CPallini 4,500
2 Sergey Alexandrovich Kryukov 4,482
3 George Jonsson 3,057
4 Gihan Liyanage 2,445


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 28 Mar 2012
Copyright © CodeProject, 1999-2014
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