ASP .NET Button event handlers do not fire on the first click, but on the second click after a PostBack

后端 未结 8 2045
Happy的楠姐
Happy的楠姐 2020-12-02 17:02

Background: I am customizing an existing ASP .NET / C# application. It has it\'s own little \"framework\" and conventions for developers to follow when exte

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 17:29

    Whilst its hard to know exactly without seeing the full Page_load method it does smell a little bit like the event handlers are not hooking up until the page is reloaded.

    eg:

    if (IsPostBack) {
        // Add handlers here ...
    }
    

提交回复
热议问题