AutoPostBack property - TextBox

Discussion in 'ASP .Net Web Controls' started by mg, Oct 22, 2004.

  1. mg

    mg Guest

    A WebControl TextBox posts back to the server whether or not the AutoPostBack
    property is true, when the TextBox looses focus following a text change. So,
    what's the purpose of this property?
     
    mg, Oct 22, 2004
    #1
    1. Advertising

  2. What you say is only partially true. When you use Autopostback, there's a
    postback not only when you press Enter in the testbox, but also onblur such
    as when you tab out of the textbox. Try the following code with autopostback
    true and then false and ttab in and out of the textbox. You'll see the
    difference.

    <%@ Page Language="VB" %>
    <script runat="server">

    sub page_load
    if ispostback then
    label1.text=now.tolongtimestring()
    end if
    end sub

    </script>
    <html>
    <head>
    </head>
    <body>
    <form runat="server">
    <p>
    <asp:Label id="Label1" runat="server">Label</asp:Label>
    </p>
    <p>
    <asp:TextBox id="TextBox1" runat="server"
    AutoPostBack="True"></asp:TextBox>
    </p>
    <!-- Insert content here -->
    </form>
    </body>
    </html>


    "mg" wrote:

    > A WebControl TextBox posts back to the server whether or not the AutoPostBack
    > property is true, when the TextBox looses focus following a text change. So,
    > what's the purpose of this property?
     
    Ken Cox [Microsoft MVP], Oct 22, 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. Ben Fidge
    Replies:
    2
    Views:
    3,548
    Ben Fidge
    Jan 30, 2004
  2. Neo
    Replies:
    1
    Views:
    490
    avnrao
    Jun 24, 2004
  3. - Steve -

    AutoPostBack on TextBox loses Focus

    - Steve -, Jun 29, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,545
    - Steve -
    Jun 29, 2004
  4. Mariame

    problem with AutoPostBack property of textbox!!!!

    Mariame, Nov 22, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    146
    Mariame
    Nov 22, 2005
  5. Jurjen de Groot
    Replies:
    0
    Views:
    309
    Jurjen de Groot
    May 19, 2008
Loading...

Share This Page