ASP. NET WebForm does not show the cause of __dopostback and some solutions

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.