This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / stupid question: 如何避免parent windows postback? 比如在page1.aspx里popup了一个page2.aspx,当page2在postback的时候,page1总是自动也被postback一次,如何避免这种情况?
-mfcguy();
2008-8-5
(#4599350@0)
-
在popup 的 heade 添上 <base target='_self' /> 试试
-c1xwy(洪兴罩俺去战斗);
2008-8-5
(#4599432@0)
-
Very confused. By default, page2 only requests itself, page2, unless you specify some control’s PostbackUrl to other page. How can it requests two pages simultaneously?
-deep_blue(BLUE);
2008-8-5
(#4599509@0)
-
I was confused too...when the project in test server was fine, in my local laptop just keep refreshing both pages.
-mfcguy();
2008-8-5
(#4599900@0)
-
I assume it is this kind scenario.In page 1, there is a button and client-side javascript code to popup page 2. In this case, after popup function (request to page 2), you have to stop continuing by ‘return false’. Otherwise it still submits to server (postback to page1). The code should like:
Button.OnClientClick = "window.open(‘page2.aspx’,other_parameters); return false;”;
-deep_blue(BLUE);
2008-8-6
{352}
(#4600087@0)
-
you are an amazing technical guy, thanks a lot, it works!
-mfcguy();
2008-8-6
(#4600293@0)
-
You provided lots of misleading information. page2 is not 'PostBack', and why there is difference in test server and laptop? different browser ?
-holdon(again);
2008-8-6
(#4600317@0)
-
I don't know how you popup page2.aspx. but I never have such issue in my .net pages. Usually I build hyperlink in codebehind of page1 and assign text & url to this hyperlink control.So I input javascript window.open page2. I can postback page2 and page1 stay cool...
hope this helps
-whereismyid(到处找ID);
2008-8-5
{103}
(#4599839@0)
-
interesting..your problem is actually a solution for me for synchronzing cross pages update. :)
-sunday8(sunday8);
2008-8-6
(#4600495@0)
-
好了,不confuse大家了,这个问题是浏览器的问题,用IE7就是自动刷,deep blue的方案也不可行,用firefox就没这个问题,我不管了,不过还是谢谢大家的帮助!
-mfcguy();
2008-8-6
(#4600758@0)
-
it's almost certain a Javascript issue. .Net implement Button as <input type=submit>, which is not always best solution; If I found Asp.Net Button cannot' do what I need to do, I will user HTML <input type=button>
-holdon(again);
2008-8-6
(#4601002@0)
-
check this url : http://www.xerratus.com/CommentView,guid,5a3ee461-185b-4253-9f98-2a9254208b15.aspx#commentstart
-holdon(again);
2008-8-6
(#4601018@0)
-
I tried to reproduce your error. However, no matter in IE 7 or FF (both XP and Vista systems), there is no your problem at all.However, in worst case scenario, you can use a hyperlink (not link button). And put
NavigateUrl = "javascript:window.open('page2.aspx', ...)"
Here, you must not have 'return false' statement
-deep_blue(BLUE);
2008-8-6
{218}
(#4601428@0)