Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想要一个在服务器上运行的按钮,但在回发之前它应该运行一个或多个 javascript 函数。
这可能吗?
function runSomeStuff() { callYourCode(); callSomethingElse(); __doPostBack('btnSave', "Some String To Post Back"); }
是的,这是可能的。
OnClientClick="return func1();"
记住你的函数 func1() 应该返回 bool true/false。如果它返回 false,则不会有回发。