ASP.NET Postback concept

What is the concept of Postback in ASP.NET?

A Postback is a type of request in Asp.net Programming sent by client to server from the single page user is already working with same page.The Post back request reload the page.


ASP.NET was provide a mechanism to post an HTTP POST back request in the same page. It’s  posting a complete page back to server (reload page) on same page. So, the whole page is refresh.
Other Hand one more related  concept related to this is “Callback” that is also asked sometimes in interview question. And it is also very popular Question.

Example: 

  •         Open .net IDE and create new web site.
  •          Right click on website root name and select new item.you get a new window
  •          Then select the .aspx page.
  •          Give the name of this page and click Add button.
  •          Now open this web page into designe window then you see a <form> tag.
  •          Modify this tag as:-
<form method=”post” action=”WebForm1.aspx” id=”form1″>

here you inbuilt post method in this Asp.net page.now run this Application/web site when this run and we reload page then every time full page reload again and again.and page fully reload. 

Code for .aspx page in asp.net programming:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server" method="post" action="Default2.aspx">
    <div>
    
    </div>
    </form>
</body>
</html>



Related Post:

Reference : 

Jquery Related Other post: