HighTechTalks DotNet Forums  

Problem with order that properties are set from aspx page

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Problem with order that properties are set from aspx page in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
cope.andrew@gmail.com
 
Posts: n/a

Default Problem with order that properties are set from aspx page - 06-07-2007 , 09:48 AM






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


Reply With Quote
  #2  
Old   
John Saunders [MVP]
 
Posts: n/a

Default Re: Problem with order that properties are set from aspx page - 06-07-2007 , 01:46 PM






<cope.andrew (AT) gmail (DOT) com> wrote

Quote:
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]




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.