Background: Two-time ASP. Three-tier server controls for development
Today, at the time of development, we found a lot of things in this system that were encapsulated and found a problem.
Dopostback how this method is used
Because I found out that some HTML elements have neither the method of binding interaction nor the server control
You click to interact with the data
Carefully studied the next decision to share the next
First add a server control
Binding methods to server controls
When you click on a page, such as
Then I added an HTML element in JS to give it a way to bind Dopostback.
You can then execute the method used by the first server control as shown in this HTML element
View page Source Discovery page automatically generated this thing
Combining the parameters of the Dopostback
AAA is actually eventtarget "" is the back of the eventargument
As for that return false is to prevent the page from continuing to execute
Because the Form1 form is only executed after the Bbb_onclick () the first sentence in this method
__doPostBack (' AAA ', '); If you have BBB, there's a follow-up to this method, and the page continues.
So when you're using it, it's best to add this return false, after all, this is the best way to write.
Another way to simulate a server click
Like this, it can be done.