Please help me understand the ASP.NET control's AutoPostBack property.

I learn ASP.NET, mainly following the book, but also make efforts to actually do something along the way. But I came across an explanation of list controls that I don't understand. Here is what he says:

"[in the context of the Smart Tasks panel] ... the last parameter sets the control's AutoPostBack property. If this check box is selected, the control will send the page contained on the server as soon as the user selects a new item from the list"

Can you explain this expression to me? Thanks in advance for your help.

+3
source share
6 answers

( AutoPostBack, false), , . , , - , . - , script.

AutoPostBack true, ( HTTP POST). ASP.NET , , .

+5

AutoPostBack="true" , , .

, , - , , .

, , , AutoPostBack="true".

+3

ListBox SelectedIndexChanged, , , ListBox . :

<asp:ListBox ID="ListBox1" runat="server" OnSelectedIndexChanged="ListBox1_SelectedIndexChanged"/>

protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    // Do something         
}

AutoPostBack="false" ( ) . (POST) , , , .

" " , AutoPostBack="true", .

- . - , "" .

: http://www.dotnetspider.com/resources/189-AutoPostBack-What-How-works.aspx

+3

ListItem ( ), - POST.

wikipedia HTTP POST http://en.wikipedia.org/wiki/HTTP_POST

+1

asp.net, Page, , html, . AutoPostBack. , javascript, , , .

+1
  • , AutoPostBack , , , .
  • , . , , AutoPostBack = "true", , .
  • , , , .
  • ASP.NET. AutoPostBack .
  • . . DropDownList: : DropDownList, :
  • Write something in this event handler, say: Response.Write ("message");
  • The page refreshes and you see a message, this means that the page was sent to the server, and the server executed an event handler and displayed a message to you.

I hope this was helpful

0
source

Source: https://habr.com/ru/post/1736118/


All Articles