__doPostBack does not work in firefox

__doPostBack does not work in firefox 3 (did not check 2). Everything works fine in IE 6 and 7, and even works in Chrome

This is a simple asp: LinkButton with an OnClick event.

<asp:LinkButton ID="DeleteAllPicturesLinkButton" Enabled="False" OnClientClick="javascript:return confirm('Are you sure you want to delete all pictures? \n This action cannot be undone.');" OnClick="DeletePictureLinkButton_Click" CommandName="DeleteAll" CssClass="button" runat="server">

The javascript validation is triggered, so I know that javascript is working, this is specifically the __doPostBack event. A lot of things are happening on the page, I just don’t know if it works to publish the whole page.

I include the control in the page load event.

Any ideas?


Hope this is the right way to do this, but I found the answer. I decided that I would put it here and then in stackoverflow "answer"

This seems to be due to the attachment of the ajax UpdatePanel applet. When I removed the top-level panel, it was fixed.

, , - . , , .

+3
14

User Agent. , , , "googlebot". JavaScript , , .

http://support.mozilla.com/tiki-view_forum_thread.php?locale=tr&comments_parentId=160492&forumId=1:

reset : config . . general.useragent , (, 4 ). - , Reset

+5

(__doPostBack ) Firefox - . HTML. HTML :

<input type="button" id="yourButton" onclick="doSomethingThenPostBack();" value="Post" />

"doSomethingThenPostBack" - JavaScript, __doPostBack, Firefox. PostBack IE Chrome. , , HTML:

<input type="submit" id="yourButton" ...

- . " " Firefox __doPostBack. , , . , - , .

+3

, return? , . , if

if (!confirm(...)) { return false; } _doPostBack(...);

js OnClick ?

EDIT: , , ,

<a href="javascript:__doPostBack()" onclick="return confirm()" />
+1

, , firefox ? - , .

+1

PageLoad? ,

if (!isPostBack)
{
    //do something
}
else if (Request.Form["__EVENTTARGET"].ToLower().IndexOf("myevent") >= 0)
{
    //call appropriate function.
}

, , , , , nedes .

+1

"Enabled =" false "??

+1

firebug -, - , .

+1

OnClientClick - .

_doPostBack - javascript, .NET.

function __doPostBack(eventTarget, eventArgument) {

    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {

        theForm.__EVENTTARGET.value = eventTarget;

        theForm.__EVENTARGUMENT.value = eventArgument;

        theForm.submit();

    }

}

* & 95; , , stackoverflow.

0

, , , javascript: . , onclick - javascript. , , .

0

, ajax UpdatePanel. , .

, , - .

0

-, , .

, -, , !

:

...

, : ...

IE ( ).

0

. , Akamai user-agent, , .

, .NET __doPostBack. .

0

@Terrapin: ( , ).

User Agent Switcher Googlebot 2.1.

Reporting Services 2008 iframes, , 300x200 , Reporting Services 2008 R2 "__doPostBack undefined" .

.

0

Firefox. __doPostBack() jQuery.trigger(), click , click?

, aspx:

<asp:Button runat="server" ID="btnMyPostback" OnClick="btnMyPostback_Click" CssClass="hide" ToolTip="Click here to submit this transaction."  />

postback :

 protected void btnMyPostback_Click(object sender, EventArgs e)
 {
     //do my postback stuff
 }

, :

$("#btnMyPostback").trigger("click");

This will trigger an event Page_Loadif you need to do something on Page_Load.

0
source

Source: https://habr.com/ru/post/1696788/


All Articles