Properties

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

Hi Jeffrey,

I am aware that you can pass parameters into the class in a number of ways
but I need to pass the parameters via get and set methods because each use
placeholder is instantiating the same user control but with different
property settings.

My problem is that when I LoadControl I don't have the ability to go for
example c1.Mode = "edit". Do you know how to get around this?

By the way I like your site.

public string Mode
{
get
{
return mode;
}
set
{
mode = value;
}
}

Josh
 
ControlClass.ascx.cs:
public class ControlClass : System.Web.UI.UserControl
{
private string mode;
public string Mode
{
set{mode=value;}
get{return(mode);}
}
}

The page which to load ControlClass.ascx:
ControlClass cc=(ControlClass)LoadControl("ControlClass.ascx");
cc.Mode="Mode";
this.Controls.Add((UserControl)cc);

Is this what you want?
 
Back
Top