Textbox in an Edit template of a C1WebGrid

Legacy

A description has not yet been added to this group.

Textbox in an Edit template of a C1WebGrid

  • rated by 0 users
  • This post has 1 Reply |
  • 0 Followers
  • I'm using an asp:TextBox in an EditItem template of a C1Webgrid and would like to tie a Client-side event handler to it to evaluate the user input when they are finished entering text.  When I try to tie a client-side event handler to the textbox, I cannot from the server side as it doesn't yet exist.  I tried trapping the Editing event, but the textbox still doesn't exist at that point.

    Is it possible to tie a client-side event handler to an asp:Textbox in an Edit template of a C1WebGrid?

     <C1WebGrid:C1TemplateColumn...

                                <EditItemTemplate>
                                    <asp:TextBox ID="txtHoursE" runat="server"
                                        OnTextChanged="txtHoursE_TextChanged" AutoPostBack="true"
                                        Text='<%# Bind("Something") %>' CausesValidation="True"></asp:TextBox>
                                </EditItemTemplate>

    </C1WebGrid:C1TemplateColumn>

  • Hi,
     
    the client side event handler can be attached like this
     
    <EditItemTemplate>
        <asp:TextBox runat="server" ID="textBox1" onchange="alert('onchange')" />
    </EditItemTemplate>
    Then you should implement a function that will validate input using JavaScript.
     
    Regards,
    Sergey.
    <drjmr> wrote: news:219240@10.0.1.98...

    I'm using an asp:TextBox in an EditItem template of a C1Webgrid and would like to tie a Client-side event handler to it to evaluate the user input when they are finished entering text.  When I try to tie a client-side event handler to the textbox, I cannot from the server side as it doesn't yet exist.  I tried trapping the Editing event, but the textbox still doesn't exist at that point.

    Is it possible to tie a client-side event handler to an asp:Textbox in an Edit template of a C1WebGrid?

     <C1WebGrid:C1TemplateColumn...

                                <EditItemTemplate>
                                    <asp:TextBox ID="txtHoursE" runat="server"
                                        OnTextChanged="txtHoursE_TextChanged" AutoPostBack="true"
                                        Text='<%# Bind("Something") %>' CausesValidation="True"></asp:TextBox>
                                </EditItemTemplate>

    </C1WebGrid:C1TemplateColumn>



    http://helpcentral.componentone.com/cs/forums/p/79642/219240.aspx#219240

Page 1 of 1 (2 items)