Getting custom properties on a user control

Discussion in 'ASP .Net' started by Boban Dragojlovic, Jun 24, 2003.

  1. 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?
     
    Boban Dragojlovic, Jun 24, 2003
    #1
    1. Advertising

  2. Boban Dragojlovic

    PJ Guest

    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

    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:Et3Ka.1062$...
    >
    > 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?
    >
    >
    >
     
    PJ, Jun 25, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nathan Sokalski
    Replies:
    0
    Views:
    957
    Nathan Sokalski
    Oct 17, 2005
  2. Max2006
    Replies:
    2
    Views:
    538
    Max2006
    Jul 13, 2007
  3. Nathan Sokalski
    Replies:
    0
    Views:
    229
    Nathan Sokalski
    Oct 17, 2005
  4. Ziyad Makki
    Replies:
    0
    Views:
    120
    Ziyad Makki
    Jul 13, 2004
  5. Nathan Sokalski
    Replies:
    0
    Views:
    247
    Nathan Sokalski
    Oct 17, 2005
Loading...

Share This Page