Getting custom properties on a user control

  • Thread starter Thread starter Boban Dragojlovic
  • Start date Start date
B

Boban Dragojlovic

I created a user web control, and here is the line in my ASPX that consumes
that control.

<joe:RunningSummary CurrentStep=2 id=myRunningSummary runat=server />


The "CurrentStep=2" is supposed to be a "custom property" and I would invoke
this user control with different values on various web forms.


How do I retrieve the value of "CurrentStep" within the code-behind of the
user control?
 
just as you would any property from any control. assuming that you have
your property defined in your control something like this

[Bindable(True), Category("Behavior"), DefaultValue("")]
Public CurrentStep() As Integer
{
get { return ViewState["step"]; }
set { ViewState["step"] = value; }
}

//in page code behind
protected RunningSummary rs;
....
rs.CurrentStep = 12;


~PJ
 
Back
Top