简体   繁体   中英

anchor and onclick with asp.net postback

I have a link like this

<a href="#thumb" id="ctl00_allContent_btnThumb" onclick="javascript:__doPostBack('ctl00$allContent$btnThumb','')"><img alt="" src="../../images/bullet-thumb.gif"></a>

On Firefox it does what it supposed to. But it won't work on IE or Chrome.

I know there are some questions on the subject here, but they haven't helped me. I'm guessing it's more specific since it envolves ASP.NET postback.

thank you

Make sure that you don't have client validation controls on the page.

That controls are not working in Firefox, but working in IE and Chrome.

So probably failing of client validation is blocking you from submit the form.

尝试从事件中删除“ javascript:”。

我强烈建议您将其更改为类似的内容

<asp:LinkButton ID="myLinkButton" runat="server" OnClick="myLinkButton_Click"><img alt="" src="../../images/bullet-thumb.gif" style="border:0"></asp:LinkButton>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM