Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/422.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为什么任何html按钮都会导致aspx页面中的回发?_Javascript_Html_Asp.net_Sharepoint - Fatal编程技术网

Javascript 为什么任何html按钮都会导致aspx页面中的回发?

Javascript 为什么任何html按钮都会导致aspx页面中的回发?,javascript,html,asp.net,sharepoint,Javascript,Html,Asp.net,Sharepoint,我已经在SharePoint网站上创建了.aspx页面,并插入到页面HTML按钮中 示例 <PublishingWebControls:editmodepanel PageDisplayMode="Display" runat="server" SuppressTag="True"> ... <button>Click Me!</button> ... </PublishingWebControls:editmodepanel> ...

我已经在SharePoint网站上创建了.aspx页面,并插入到页面HTML按钮中

示例

    <PublishingWebControls:editmodepanel PageDisplayMode="Display" runat="server" SuppressTag="True">
...
<button>Click Me!</button>
...
</PublishingWebControls:editmodepanel>

...
点击我!
...
每次我点击“点击我!”回发发生。这不是我想要的行为,但我已经找到了一种方法,可以避免引起回帖。我将javascript代码添加到onclick属性
单击我

我的问题是,即使按钮不包含
type=“submit”
属性,为什么会发生回发

我还检查了母版页,其中包含
并包装了所有内容,并且没有
action=“page.aspx”
属性。

检查此链接,
页面上有一条说明,不同的浏览器可以为按钮使用不同的默认类型,如果您不自己指定的话。似乎你的浏览器使用了“提交”。

我知道这是一篇老文章@Dmytro的帖子引导了正确的方向,但不是确切的答案。要防止回发,需要使用按钮标记的type属性。i、 e


点击我

每个浏览器对按钮标签的解释都不同。您可以使用
,它也不应该导致回发。@Jmoreland91您应该将此作为答案编写。我会投赞成票的。我已经调试我的应用程序好几个小时了,这神奇地修复了一切!你救了我的好朋友!