I created a very similar control.  For a company that did multiple
events and needed registration forms that varied from event to event. 
I actually added a field in my table "isRequired" and then I handled
it with a Case statement based on the type of control (e.g. textbox,
dropdown, etc... ) and if the field was isRequred=true then I would
add a validator when I created the table and controls.

HTH
Ronda


On Thu, 16 Sep 2004 09:02:17 -0000, moron_psychomaniac
<[EMAIL PROTECTED]> wrote:
> I have just created a dynamic ASP.NET form. The fields and its type
> (textbox, checkbox, radiobutton, etc) are controlled through the SQL
> database.
> Now I want to validate user-input by using the validator provided by
> ASP.NET. However, I can't really do it because all my controls
> (textbox, checkbox, etc) are created dynamically.
> Here's a sample to the code for validator:
> 
> <asp:RequiredFieldValidator id="valRequired" runat="server"
> ControlToValidate="textbox1"
>    ErrorMessage="* You must enter a value into textbox1"
> Display="dynamic">*
> </asp:RequiredFieldValidator>
> 
> Notice that it has a field "ControlToValidate". It means I have to
> specify the name of the control to be validated even before the
> control itself is even created.
> 
> Anybody has a suggestion?
> Thanks a lot!
> 
> 
> 
> Yahoo! Groups Links
> 
> 
> 
> 
>


------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to