// Create Custom Property in Webpart ---------------------------
[
Personalizable(),
Category("Miscellaneous"),
DefaultValue(""),
WebBrowsable(true),
WebDisplayName("Enter SK Form ID"),
WebDescription("Enter SK Form ID")
]
public string SKForm
{
get { return _skform; }
set { _skform = value; }
}
// End of Create Custom Property in Webpart ---------------------------
//-------------------------------------------------------------
protected override void CreateChildControls()
{
base.CreateChildControls();
userControl = (UserControl)Page.LoadControl(@"/_controltemplates/PraveshUserControl.ascx"); // Call UC
Type myControlType = userControl.GetType();
PropertyInfo MyControlProperty = myControlType.GetProperty("FormGUIDNos");
MyControlProperty.SetValue(userControl, SKForm, null); // Set value to UC Public Property
this.Controls.Add(userControl);
}
// End of -------------------- Create Child Controls
//-----------------------User Controls---------
public string _guidno;
public string FormGUIDNos
{
get { return _guidno; }
set { _guidno = value; }
}
// and Access this property anywhere in UC
MCTS, Share point,BA, UML, XML,Framework 1.1/2.0/3.5,Asp.net, Biz Talk Server, SPD, Windows server 2000/03/08
Monday, March 28, 2011
Monday, May 17, 2010
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).
this error comes whenever you add runat="Server" in Head TAG. so remove from it and it will work
this error comes whenever you add runat="Server" in Head TAG. so remove from it and it will work
Subscribe to:
Posts (Atom)