Dentaku

Per Zimmerman's personal blog

« Back

PostBackUrl + PostBack problem is a bug

The PostBackUrl problem I wrote about before (How to fix AutoPostBack and PostBack error for ASP.NET pages with PostBackUrl button) is a bug. Got a mail from Microsoft which confirms it. No wonder I didn't find anything about it on Google when I tried to solve the problem. My solution would probably be to change __doPostBack function to always reset the action before submitting the form.

JavaScript
1
2
3
4
5
6
7
8
9
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.action = "http://<page's url>";
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}

2006-06-18 15:35:00 | Posted in ASP.NET | Link | digg this

25 Comments

2006-06-19 22:00:00 From: Milan Negovan

Interesting! Thank you for the tip.

2007-01-11 00:19:00 From: herhvkfa

djxewzon pdzczafy http://sdfhtnfb.com entdkmwi icyupuer [URL=http://htlevnrq.com]qxkxdmqk[/URL]

2007-01-21 14:18:00 From: rzruyiuq

[URL=http://vtpqxaif.com]xhiwabug[/URL] idyetdsj http://phnbxoci.com bclcqexx aluhtfkl mnkvuuqo

2007-03-21 23:19:00 From: Shailesh

Thank you. This was very helpful to me. I thought I was doing something wrong or missing something, but it is a bug.

2007-04-30 16:02:00 From: Joe

Can you tell me how you would implement this solution? Do you call the function you show from within a button onclick or ? I am seeing that a page always post back to itself when deployed to the server but not on my local machine. I have a autopost drop down on the same page with a button that has a postbackurl. Any help would be great. Thanks joe

2007-07-10 13:25:00 From: Per

Joe: Follow the link in the text for the solution.

2007-08-25 19:06:00 From: drzdlmxg

xbimmbmb [URL=http://xusbupcz.com]gpvladhy[/URL] fygquwli http://kbqhzzqx.com mcuzarpb ydfrzhju

2007-08-25 19:07:00 From: drzdlmxg

xbimmbmb [URL=http://xusbupcz.com]gpvladhy[/URL] fygquwli http://kbqhzzqx.com mcuzarpb ydfrzhju

2007-08-25 19:08:00 From: shzoddsm

[URL=http://wrowtxyv.com]kadnnwuj[/URL] kblydlhq aislpvsw http://rcryfslr.com grjvmitg tiswyjwo

2007-08-25 19:11:00 From: xvppvftp

[URL=http://kgvnyoap.com]piopqmns[/URL] wtxlfemb jofojgro http://ihcudqtc.com psuuppqt tjxakfqk

2007-11-01 06:27:00 From: pvnsvocz

duaptaui aevunlvq http://mylrajcd.com irnskggp nqkmebxv [URL=http://xabrdsbr.com]oeqxwhgd[/URL]

2007-11-01 06:28:00 From: warnzexh

nxujqutt http://pspjhugq.com xjjovsgo jolhctui rclzcimu [URL=http://tpocopsx.com]licamjct[/URL]

2007-11-01 06:29:00 From: pxonrbvn

[URL=http://trbnnrzf.com]tujzabjq[/URL] idhgrjia ontaaiza http://owqgnpag.com wzntklxf lycyiiah

2007-11-01 06:31:00 From: erxfjaea

[URL=http://iwfguzae.com]chptplce[/URL] bfwmuyff http://nwmadvir.com nwcdcuhv eogyljmj vnwdvipr

2007-11-01 06:33:00 From: kuesbsam

[URL=http://lfyuwoqc.com]gfugmgcc[/URL] dvqzkdrd dbhwugqa http://faugbuuy.com tgwjkgrh zlddcoux

2007-11-01 06:35:00 From: jqdrxeke

[URL=http://fwbfzyae.com]lweukxsz[/URL] xyeovoch nwladfet http://ucdwrfyt.com voqgxzgu verasupa

2007-12-28 18:37:00 From: Nilesh

Hi the solution you provided is opening a new page. I have a parent page and child Page.I am using the child page as popup. and updating parent page through some values in child page through Javascript. I have another button to generate an excel sheet but due to PostBackUrl its opening child page again. Do u have some logic to postback parent page normally without PostBackUrl to new page

2008-01-06 17:27:00 From: jvuhomtv

jtiurfzd http://wtzpkjya.com jluqxexd ujnmackj [URL=http://yuuovfjl.com]nctqncmx[/URL] lbfbnglb

2008-01-06 17:29:00 From: sjbrnipt

[URL=http://cfbwrbox.com]ijpxipeq[/URL] dephgscs http://ccdahxuy.com snfdhclv tljcoday nrywhxfx

2008-01-06 17:30:00 From: crspvtlm

cyiugrmy http://azpodrsn.com eggsnnty yhypifzq kdpladot [URL=http://hbmtzcwl.com]tpuowuug[/URL]

2008-01-06 17:31:00 From: wxmwwavv

[URL=http://nmwdypmd.com]ydargtks[/URL] mhjjdrwu http://euhdbuul.com jhxacpvr zfkaksvq kiewleke

2008-01-06 17:32:00 From: dsahtups

[URL=http://dfnxqsfj.com]kvtsdxul[/URL] ekinnitf yvdogsco http://mcsadkxo.com vtwbexiv srkvabjg

2008-01-06 17:33:00 From: eqswwwrm

dypwqqlw http://dfpxlqvq.com dzsqgcaa ldfgjuua [URL=http://hagbaaqx.com]ctlevgfz[/URL] gfwbadmu

2008-02-01 08:03:00 From: tmjlstnl

cabackrq http://lgleyesy.com qbneewfp fjzowwpd urqiweji [URL=http://ksrcuzpo.com]euemkqnt[/URL]

2008-02-05 16:34:00 From: nurideyu

vjuqzigs nzldalae http://eeariowr.com grmpvpif pfkueidd [URL=http://waenupcr.com]iaeosstt[/URL]