This project is read-only.

need a way to set EasyControl properties declaratively

Nov 16, 2009 at 6:35 PM

All --

I think the Mwpsk does need a way to set EasyControl properties declaratively.

For example, for a regular user-control, one can set design-time properties, in the code-infront of a page that uses a user control, in the VS.NET IDE for all public properties that exist in the target user user contol.

For an EasyControl, there seems to be no way to do this when adding a control at run-time.

I know the context is different (run-time-context versus design-time-context)-- regardless, it would be nice to do it at run-time in the Mwpsk.

I have an idea of one way this might be done, even now-- by making a companion control for settings, so one would have MyControl.ascx and MyControlSettings.ascx. The MyControl.ascx would use a defaults for its public properties when MyControlSettings.ascx is not on the page. When MyControlSettings.ascx is on the same page as MyControl.ascx, then MyControl.ascx would use MyControlSettings.ascx to get the value for the public properites in the MyControl.ascx control. Etc. This would be a bit "late bound" and would probably need "FindControlRecursively()". It is a bit of a crazy idea but it just might work. If I get a chance to implement it, then I will try to postback the resutls.

Anyway, there is probably a better, more generic way to do it.

HTH.

Thank you.

-- Mark Kamoski

Nov 20, 2009 at 9:58 PM

All --

Another way to this MIGHT be to wrap the control in a Web Part.

That would persist the properties as-needed, allow for run-time editing, etc.

However, that would require the Aspnet Service Tables, which is fine IMHO, but it would break the "it should run without a database" rule.

It is just a thought.

HTH.

Thank you.

-- Mark Kamoski