WebControl.TextBox embedded in an HTML table

Discussion in 'ASP .Net Web Controls' started by Glenn Thimmes, Jul 6, 2004.

  1. I have a few textboxes inside a client side HTML table. When I type text in
    them and click a button server control that causes a post back to the
    server, the textboxes contain empty strings in the button click event. If I
    have a textbox outside the table, however, it does contain test during the
    button click event.

    Is there a reason why the textboxes do not function properly inside an HTML
    table?

    Thanks,
    Glenn Thimmes
     
    Glenn Thimmes, Jul 6, 2004
    #1
    1. Advertising

  2. Hi Glenn,

    I can't reproduce your problem in my code (see below). Could you post the
    troublesome code so we can investigate it?

    Private Sub Button1_Click _
    (ByVal sender As System.Object, _
    ByVal e As System.EventArgs) _
    Handles Button1.Click
    Dim sb As New System.Text.StringBuilder
    sb.Append(TextBox1.Text & "<br>")
    sb.Append(TextBox2.Text & "<br>")
    sb.Append(TextBox3.Text & "<br>")
    sb.Append(TextBox4.Text & "<br>")
    sb.Append(TextBox5.Text & "<br>")
    Label1.Text = sb.ToString
    End Sub

    <TABLE id="Table1" cellSpacing="1" cellPadding="1" width="300"
    border="1">
    <TR>
    <TD>
    <asp:TextBox id="TextBox1" runat="server">TextBox1</asp:TextBox></TD>
    <TD>
    <asp:TextBox id="TextBox2" runat="server">TextBox2</asp:TextBox></TD>
    <TD></TD>
    </TR>
    <TR>
    <TD>
    <asp:TextBox id="TextBox3" runat="server">TextBox3</asp:TextBox></TD>
    <TD></TD>
    <TD></TD>
    </TR>
    <TR>
    <TD>
    <asp:TextBox id="TextBox4" runat="server">TextBox4</asp:TextBox></TD>
    <TD></TD>
    <TD>
    <asp:TextBox id="TextBox5" runat="server">TextBox5</asp:TextBox></TD>
    </TR>
    </TABLE>
    <P>
    <asp:Button id="Button1" runat="server" Text="Button"></asp:Button></P>
    <P>
    <asp:Label id="Label1" runat="server"></asp:Label></P>

    Ken
    Microsoft MVP [ASP.NET]


    "Glenn Thimmes" <glennthi@nospam_msn.com> wrote in message
    news:...
    >I have a few textboxes inside a client side HTML table. When I type text in
    > them and click a button server control that causes a post back to the
    > server, the textboxes contain empty strings in the button click event. If
    > I
    > have a textbox outside the table, however, it does contain test during the
    > button click event.
    >
    > Is there a reason why the textboxes do not function properly inside an
    > HTML
    > table?
    >
    > Thanks,
    > Glenn Thimmes
    >
    >
     
    Ken Cox [Microsoft MVP], Jul 7, 2004
    #2
    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:
    218
    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