Client Rendering Problem after 'page.' calls

369 views Asked by At

I have tried, 'PreviousPage', 'PreviousPage.IsCrossPagePostBack' 'Page.previousPage', page.title

It causes the client to stop rendering the page after this line.

simple example

protected void Page_Load(object sender, EventArgs e)
{
response.write("I can see this");
string test = PreviousPage.IsCrossPagePostBack.toString(); //Any page call Causes client rendering to freeze
response.write("But i cant see this");   
System.Windows.Forms.MessageBox.Show("However i can see this,proving that the server is still running the code");   
}

Anybody Please, any ideas?

2

There are 2 answers

0
Marc Gravell On

Have you checked PreviousPage for null?

From msdn:

The PreviousPage property is a null reference (Nothing in Visual Basic) when the user requests that page directly from the server.

Also - MessageBox in a web form, not a great idea... perhaps use the inbuilt trace.axd

0
AudioBubble On

ANSWER

Well it ended up it was something stupid. code smell over.

The button i was using to fire the PostBack had a handler that fired to redirect, i just deleted the handler, keeping the PostBackUrl setting and magic.