Getting custom properties on a user control

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?
 
P

PJ

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top