To maintain the old ASP. NET WebForm system, a problem was found today: the ASP. NET page does not automatically generate the __doPostBack method, suggesting that the JS method does not exist. So on the internet to find a lot of methods, basically said is the problem of IE, but I use chrome AH. When looking for a method, it is suddenly discovered that it is necessary to add an ASP. asp. NET will parse and automatically generate the __doPostBack method? Originally the list page contains a server paging control, or a new LinkButton bar, in the background code to write its click Method, in the. aspx page to hide it. After testing, the current list page automatically generates the __doPostBack method.
The __doPostBack method is automatically generated by the runtime when the following code is added to the. aspx and. cs pages.
. aspx page
<div style="display:block; "> <asp:linkbutton id="btn "runat="server" onclientclick="return PostBack (' btn '); " onclick="btn_click"></asp:LinkButton> </div>
. CS Page
protected void Btndelete_click (object sender, EventArgs e) {}
ASP. NET WebForm does not show the cause of __dopostback and some solutions