Wednesday, April 15, 2009

Passing parameters to user controls c# asp.net

Passing parameters to user controls c# asp.net
user control:
private string _InstructorFinderSide;
public string InstructorFinderSide
{
get { return _InstructorFinderSide; }
set { _InstructorFinderSide = value; }
}
From within the user control you can simply refer to "InstructorFinderSide" fromthereonin to get the value that was assigned to it by the parent.

Parent:Two methods
<-uc2:InstructorFC ID="InstructorFinder" InstructorFinderSide="right" runat="server"/>
in codebehind
InstructorFinderSide="right"

No comments: