Problem with order that properties are set from aspx page

Discussion in 'ASP .Net Building Controls' started by cope.andrew@gmail.com, Jun 7, 2007.

  1. Guest

    Hi

    I've developed an ASP.NET server control with 2 properties, PropertyA
    and PropertyB. The setter for PropertyB uses the value of PropertyA to
    perform some checking when set at designtime.

    When the aspx page is opened in the designer, the properties are read
    in from the aspx markup but the order the properties are set can't be
    guarenteed. Sometimes the setter for PropertyB is called before the
    setter for PropertyA and the code falls over.

    Is there a way, at designtime, to get round this? E.g. force one
    property to be set from the designer before another etc?

    Cheers

    Andy
    , Jun 7, 2007
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    > Hi
    >
    > I've developed an ASP.NET server control with 2 properties, PropertyA
    > and PropertyB. The setter for PropertyB uses the value of PropertyA to
    > perform some checking when set at designtime.
    >
    > When the aspx page is opened in the designer, the properties are read
    > in from the aspx markup but the order the properties are set can't be
    > guarenteed. Sometimes the setter for PropertyB is called before the
    > setter for PropertyA and the code falls over.
    >
    > Is there a way, at designtime, to get round this? E.g. force one
    > property to be set from the designer before another etc?


    I don't think there's a way to do this, and it would not be a good idea.
    What would happen if the designer weren't used? What if the properties were
    set in markup?

    The order of setting properties should not matter. If you need property A in
    property B, you should first check to see if it has been set.
    --
    John Saunders [MVP]
    John Saunders [MVP], Jun 7, 2007
    #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. Sriram Mallajyosula

    How do I post data from aspx page to another aspx page.

    Sriram Mallajyosula, Nov 5, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    976
    Steve C. Orr [MVP, MCSD]
    Nov 5, 2003
  2. John Hamm
    Replies:
    0
    Views:
    410
    John Hamm
    Nov 19, 2003
  3. Marco Antonio Montalvo Durán
    Replies:
    2
    Views:
    4,106
    Matt Morris
    Jan 23, 2004
  4. John M
    Replies:
    1
    Views:
    1,138
    Kumar Reddi
    May 29, 2005
  5. =?Utf-8?B?Uk1M?=
    Replies:
    1
    Views:
    556
    =?Utf-8?B?QW5keSBMdWtzaWM=?=
    Sep 16, 2005
Loading...

Share This Page