Last post Nov 14, 2010 12:02 AM by jkirkerx
Nov 12, 2010 05:54 AM|Inx|LINK
Is there anyway to mark a property of a custom control to be required..like the runat-property currently is..I want to create my own property and require the one useing the control to use a a speciall property of the control...I want to validation to also
be visible once you write the markup-code..so for instance if the property is called "Name" and the markup-code for the property whould look something like:
<cc:MyControl runat="server" Name="MyControlName" />
the above should validate..
but if i write
<cc:MyControl runat="server" />
I want to be shown a message telling me that this is an invalid way of useing the control..
Thanks in advance!
Nov 12, 2010 06:07 PM|Inx|LINK
Im not quite sure if everyone understod the question...so I will rephrase myself..
What I "simply" want to achive is to create custom rules about how the server control should be formated once its used as a control(<cc:Example runat="server" />)
As you probably all know your properties/attributes might some times get highlighted if you give em an incrorrect value or simply format them the wrong way...I want to be able to control that highlighting and error-reporting..if there is anyway to do that..
So for instance if someone writes something like:
I whould like the control to get highlighted just like runat gets in this example: <asp:Lable runat />..but in my case I whould like to hightlight the whole control..but just where the error is whould be fine aswell..and then once you hover the mouse over
the highlighting I whould like to show a custom message for that exception..so for in the example above I whould like to show a message saying:
"The Name attribute ain specified"..or something similar
I know this might be "impossible" to achive..but I kind of just thought that maybe someone out there actually might know a way :)
Nov 14, 2010 12:02 AM|jkirkerx|LINK
I understand the question
You may want to consider just saying that if the property is blank, assign a temp name for the control, and use a tenp name that would promote the developer to assign the name, so the silly temp name is not the name.