owl

Wednesday, September 30, 2009

To Dynamically Load a user control in aspx page

To dynamically load a user control in aspx page and call a public function in user control through the aspx page.


Control Guest_Comments = Page.LoadControl(Page.ResolveUrl("~/ResponseChunk.ascx"));
PHIndex.Controls.Add(Guest_Comments);
((ResponseChunk)Guest_Comments).GetRatingResponse(Convert.ToInt32(_PropertyID));

No comments: