I am attempting to allow my web designers to use the metadata we have about database fields in the asp.net pages they are creating. The most obvious one is as follows:
<asp:TextBox runat="server" id="txTextBox" MaxLength="<Value From Metadata here>" ... />
All the required metadata is stored in our class objects and is accessible due to its public static nature.
The benefit of this would be that they can set values which
a) might change without them being aware or caring
b) improve the user experience with very little coding effort
and all without having them need worry about what the value is or where it has come from. This will primarily be used for automatically bound controls - i.e. ones which are added with little or no developer interaction.
This question is very similar to One of my previous questions which now works wonderfully (but that was in WPF / XAML ).
The main point of this question is that I want as little developer requirement on this as possible - Ideally there would be some <%# Constant.Value %>
type syntax which could be used directly within the Maxlength=""
attribute of the asp:Textbox control meaning that no code needs to be added to a page/usercontrol at all.
I have a feeling it isn't possible, but I would love someone to prove me wrong.
Ta