Re: Can you set a "required attribute" on control property?
- From: intrader <intrader@xxxxxxx>
- Date: Wed, 14 Mar 2007 14:17:03 -0700
Cameron Eckman wrote:
When creating a property for a server control can you set some sort of "required attribute", so that the developer sees the browser message you see when you leave off an attribute on a Microsoft control:It would be helpful if you include some code.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request.
Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The required attribute 'ContentPlaceHolderID' is not found on 'Content' control.
Source Error:
For right now I am just throwing HttpParseException during the Init, but that does not behave like Microsoft's controls.
Thanks.
Cameron
Normally, in a .net application you would provide a RequiredValidator; something like:
<asp:RequiredValidator ID="someId" ControlToValidate="yourcontrolID" Display="Static" InitialValue="" ErrorMessage="Please provide a value." runat="server">
Judging by the error message you are getting indicates that you are adding your control to a placeholder that does not exist.
I hope this helps.
.
- Prev by Date: Re: web.config servercontrol binding problem
- Next by Date: Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- Previous by thread: Re: web.config servercontrol binding problem
- Next by thread: Re: Can't find other Controls from my own Control
- Index(es):
Relevant Pages
|
Loading