Today, when I run the previous project again, I find that the Click Event of the button does not work. After the breakpoint is added, I find that the event is not triggered at all ....
According to the answers found on the Internet, some people say that they should delete the controls and drag them in again. Although they have encountered a previous failure of the controls and the re-drag operation was valid, it did not work this time.
Then, continue to find the answer. Some may be form nesting, but the source code does not have this problem.
Inadvertently, I tried to add a client click event in the button:
Copy codeThe Code is as follows:
OnClientClick = "return true"
Effective:
Copy codeThe Code is as follows:
<Asp: ImageButton ID = "imgSearch" runat = "server"
ImageUrl = "~ /Images/iconSearch.png "OnClientClick =" return true "onclick =" imgSearch_Click "style =" margin-top: 5px; "/>
Although I still don't know the specific reason, I am very happy to take effect after all.