4

我正在尝试获取一个 html 按钮来调用这样的服务器端方法:

<button onserverclick="onClick" runat="server">Submit</button>

但是,当浏览器的 javascript 被禁用时,不会进行此调用。

我很困惑,因为我的理解是这个调用与 javascript 没有交互。

4

1 回答 1

3

The __doPostBack() method is responsible for raising a click event to the server in the background. With JavaScript disabled there's no way that's going to happen.

Here's one of the many articles that explains how this works. And a related question here which gives a glimpse into what code is generated behind the scenes.

于 2012-08-28T19:16:02.933 回答