Getting custom properties on a user control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Boban Dragojlovic

    Getting custom properties on a user control


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

    <joe:RunningSum mary CurrentStep=2 id=myRunningSum mary runat=server />


    The "CurrentSte p=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 "CurrentSte p" within the code-behind of the
    user control?



  • PJ

    #2
    Re: Getting custom properties on a 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("Behav ior"), DefaultValue("" )]
    Public CurrentStep() As Integer
    {
    get { return ViewState["step"]; }
    set { ViewState["step"] = value; }
    }

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


    ~PJ

    "Boban Dragojlovic" <news@_N_O_S_P_ AM_dragojlovic. org> wrote in message
    news:Et3Ka.1062 $j31.118032567@ newssvr21.news. prodigy.com...[color=blue]
    >
    > I created a user web control, and here is the line in my ASPX that[/color]
    consumes[color=blue]
    > that control.
    >
    > <joe:RunningSum mary CurrentStep=2 id=myRunningSum mary runat=server />
    >
    >
    > The "CurrentSte p=2" is supposed to be a "custom property" and I would[/color]
    invoke[color=blue]
    > this user control with different values on various web forms.
    >
    >
    > How do I retrieve the value of "CurrentSte p" within the code-behind of the
    > user control?
    >
    >
    >[/color]


    Comment

    Working...