Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Problem with order that properties are set from aspx page

Reply
Thread Tools

Problem with order that properties are set from aspx page

 
 
cope.andrew@gmail.com
Guest
Posts: n/a
 
      06-07-2007
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
 
 
 
 
John Saunders [MVP]
Guest
Posts: n/a
 
      06-07-2007
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
adding main.aspx.vb & main.aspx.resx under aspx John M ASP .Net 1 05-29-2005 09:27 PM
How to Pass values between from a popup page aspx & a normal page aspx Marco Antonio Montalvo Durán ASP .Net 2 01-23-2004 09:35 PM
Page properties reporting incorrect size when viewing an ASPX page John Hamm ASP .Net 0 11-19-2003 07:04 AM
How do I post data from aspx page to another aspx page. Sriram Mallajyosula ASP .Net 1 11-05-2003 04:48 PM



Advertisments