elsewhere home of a .NET geek

  Home  |   Contact  |   Syndication    |   Login
  21 Posts | 1 Stories | 52 Comments | 35 Trackbacks

News

This blog has random information about Managed Code and Design Pattern. Every day, while i code, the thoughts come in mind are the one you would be reading here.

If you're seeking me for asking any questions, please use the contact page of this site.

Twitter












Article Categories

Archives

Post Categories

Thursday, March 02, 2006 #

I was work around an issue. In an aspx page i am rendering an iframe content and printing the html content in the client browser (where the iframe is hidden in the same page). The reason is to control the page whether it is executed properly o(after all exception handling!!...huh!! ) or not. If the page displays any exception, i can easily check the document.body.innerHTML and avoid showing the page (I can show some error page instead).

The issue was, i had to use a asp:Button control which Response.Redirect to the another page. But, since the __doPostBack calls are forwarded to IFRAME the response goes to IFRAME, instead of going to the client browser.

The solution was, i added the below javascript in the Response.Redirect(ed) page. It worked fine.

window.onload = function() {
if ( top && top.location != window.location ) { 
top.location = self.location;
};

Thanks to Kapil, my co-worker who helped me in this.