create webcontrol at runtime

Discussion in 'ASP .Net Web Controls' started by Simon Chuang, Oct 21, 2003.

  1. Simon Chuang

    Simon Chuang Guest

    Hello,

    This is a question about creating webcontrol at runtime.

    I use a repeater to display "Name" and "Order". I hope that users can change
    the "Order" field from the browser. And, if they input invalid value (such
    as string) in the "Order" field, I hope the validator control can alert
    them. Can I do this with repeater? Or I should use other webcontrol?

    Thanks,
    Simon

    ----------------------------------------------------------------------------
    -------
    <asp:repeater id="repeater1" runat="server">
    <HeaderTemplate>
    <table>
    <TR class="gridHead">
    <TD nowrap>Name</TD>
    <TD nowrap>Order</TD>
    </TR>
    </HeaderTemplate>
    <ItemTemplate>
    <TR class="gridItem" valign="top">
    <TD<%# DataBinder.Eval(Container.DataItem, "Name") %></TD>
    <TD>
    <asp:textbox id="txtOrder" runat="server" value="<%#
    DataBinder.Eval(Container.DataItem, "Order") %>" />
    <asp:RequiredFieldValidator ID="valOrder" Runat="server"
    ControlToValidate="txtOrder" ErrorMessage="Cannot be empty." />
    </TD>
    </TR>
    </ItemTemplate>
    <FooterTemplate>
    </table>
    </FooterTemplate>
    <asp:repeater>
    <asp:Button ID="btnSubmit" Runat="server" Text="Submit" />
     
    Simon Chuang, Oct 21, 2003
    #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. Guest
    Replies:
    2
    Views:
    755
  2. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    217
    Luis Ramírez
    Jul 6, 2004
  3. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    212
    Kasabaarde Sumta
    Dec 13, 2004
  4. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    201
    Fabricio
    Sep 21, 2005
  5. Peter Morris [Air Software Ltd]

    WebControl with non-WebControl property

    Peter Morris [Air Software Ltd], Dec 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    148
    Peter Morris [Air Software Ltd]
    Dec 7, 2004
Loading...

Share This Page