Custom Control - Design Time Support

Discussion in 'ASP .Net' started by =?Utf-8?B?U2ltb24=?=, Jan 24, 2007.

  1. I am creating a custom control which is a form generator. Basically you
    define some parameters, and it will build input control (textbox), tooltip,
    validation code etc in one swoop.

    Something such as:
    1 <tt:DataForm ID="DataForm1" runat="server">
    2 <Columns>
    3 <tt:DataColumn ID="FirstName" runat="server"
    AllowDottedDecimal="False" AllowDottedHex="False"
    4 AllowDottedOctal="False" AllowHybrid="False"
    AllowIPv6="False" AllowTerritories="False"
    5 Exponent="False" Format="" Fractional="False"
    InvalidMessage="" Label="First Name" Lowercase="False"
    6 MissingMessage="" RegExp="" Required="True" Scheme="False"
    Signed="False" Trim="False"
    7 UCFirst="False" Uppercase="False"
    ValidationType="ValidationTextbox" Value="">
    8 </tt:DataColumn>
    9 <tt:DataColumn ID="LastName" runat="server"
    AllowDottedDecimal="False" AllowDottedHex="False"
    10 AllowDottedOctal="False" AllowHybrid="False"
    AllowIPv6="False" AllowTerritories="False"
    11 Exponent="False" Format="" Fractional="False"
    InvalidMessage="" Label="Last Name" Lowercase="False"
    12 MissingMessage="" RegExp="" Required="True" Scheme="False"
    Signed="False" Trim="False"
    13 UCFirst="False" Uppercase="False"
    ValidationType="ValidationTextbox" Value="">
    14 </tt:DataColumn>
    15 </Columns>
    16 </tt:DataForm>

    So lets pretend your form has 30 columns. It will create 30 textbox's based
    on the parameters you set etc.

    I am new to ASP.NET so please bare with me. I have all this working
    currently. My main issue is, if a developer is using my form generator, how
    do they access those inputs in the postback?

    Sure they can do dataForm.FindControl("something"); 30 times and then if
    textbox, if combobox, build SQL for insert/update etc. But this seems very
    ugly to me.

    How can I make the TextBox's that my control generates based on the
    parameters visible to the designer so someone can do something such as:
    Text1.Text in the postback codebehind?

    I am positive designer interface of some sort can help here but I am not
    very experienced. I have only done some basic designer stuff like
    CollectionEditor's etc.

    Any help would be greatly appreciated.

    Thanks and take care.
     
    =?Utf-8?B?U2ltb24=?=, Jan 24, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    732
  2. onyxring
    Replies:
    0
    Views:
    500
    onyxring
    Feb 15, 2006
  3. Mark Olbert
    Replies:
    1
    Views:
    526
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Feb 17, 2007
  4. Replies:
    1
    Views:
    395
    Teemu Keiski
    Jul 2, 2003
  5. MLibby

    Web Custom Control - Design Time Support ? ? ?

    MLibby, Sep 3, 2004, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    164
    MLibby
    Sep 4, 2004
Loading...

Share This Page