asp.net - CrossPagePostback: Originating page loaded twice -
i have asp.net 4.0 application uses crosspagepostback. noticed originating page being loaded twice , can't find reason why. here general logic:
basepage.vb:
public class basepage inherits system.web.ui.page protected overrides sub onpreinit(e system.eventargs) if iscrosspagepostback exit sub ... common code ... mybase.onpreinit(e) end sub protected overrides sub oninit(e system.eventargs) if iscrosspagepostback exit sub ... common code ... mybase.oninit(e) end sub protected overrides sub onload(e system.eventargs) if iscrosspagepostback exit sub ... common code ... mybase.onload(e) end sub end class page1.vb.aspx:
public class _page1 inherits basepage private sub page_load(sender object, e system.eventargs) handles me.load ... page1 specific code ... end sub end class page2.vb.aspx:
public class _page2 inherits basepage private sub page_load(sender object, e system.eventargs) handles me.load ... page2 specific code ... end sub end class in page1.aspx have asp linkbutton postbackurl set page2.aspx. set breakpoints in onpreinit, oninit , onload in basepage.vb. when linkbutton clicked in page1.aspx, 3 page events fire page1.aspx - iscrosspagepostback=true, expect originating page. 3 page events fire page2.aspx , iscrosspagepostback=false again expected.
i expect both pages done firing these page events @ point. can see page2.aspx has rendered , visible in browser, reason page1.aspx page events once again fired , time iscrosspagepostback=false allows undesired code run originating page.
if weren't setting breakpoints , debugging code you'd never know happening. there aren't noticable adverse effects happening, except it's costing processing time , know it's wrong. can't determine what's causing page1.aspx loaded again after page2.aspx loaded.
in call stack window there no caller, single line containing current sub (onpreinit, oninit or onload).
i've traced through code step step. point page2.aspx loaded , end in page event page1.aspx again.
i have linkbutton control in page2.aspx has postbackurl set page1.aspx - yet don't have problem.
does know might cause or how debug it? i've seen few posts empty img tags cause it, that's not problem here.
edit:
after all-nighter of debugging , research, i've determined originating crosspagepostback problem in fact being caused img tag missing image. big problem me img src= url coming data received in rest response have no control over.
the rest response contains lots of data, of urls images relating product. images essential page information. there millions of products , happens noticed problem on product has missing images. 99.99% of products have valid urls images, not going common problem.
yet, don't want originating page loading twice , i'd stop happening. bug originating page in crosspagepostback scenario load twice if img src= broken in target page?? there fix??
am going more research, figured i'd post followup question right away. know of solution/fix? i've read through similar posts here on missing image src cause originating crosspagepostback page load twice. answer seems either correct src url or make image available don't happen. unfortunately, don't have either of options - img src absolutely correct provided in rest response received , image not mine, it's supposed on remote server specified in rest response.
aside checking existence of each individual image before rendoring page, don't know of workaround. checking existance isn't option.
after all-nighter of debugging , research, i've determined originating crosspagepostback problem in fact being caused img tag missing image. big problem me img src= url coming data received in rest response have no control over.
the rest response contains lots of data, of urls images relating product. images essential page information. there millions of products , happens noticed problem on product has missing images. 99.99% of products have valid urls images, not going common problem.
yet, don't want originating page loading twice , i'd stop happening. bug originating page in crosspagepostback scenario load twice if img src= broken in target page?? there fix??
am going more research, figured i'd post followup question right away. know of solution/fix?
thanks.
Comments
Post a Comment