Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net Web Controls (http://www.velocityreviews.com/forums/f63-asp-net-web-controls.html)
-   -   AutoPostBack property - TextBox (http://www.velocityreviews.com/forums/t774576-autopostback-property-textbox.html)

mg 10-22-2004 03:15 PM

AutoPostBack property - TextBox
 
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] 10-22-2004 07:59 PM

RE: AutoPostBack property - TextBox
 
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?



All times are GMT. The time now is 04:10 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.