Problem with client rendering after "page". calls

I tried, "Previous page", "Previous page .IsCrossPagePostBack" "Page .previousPage", page.title

This causes the client to stop displaying 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");   
}

      

Anyone, any ideas?

0


source to share


2 answers


ANSWER

Well, that turned out to be something silly. smell of code.



The button I used to launch PostBack had a handler that triggered the redirect, I just removed the handler, keeping the PostBackUrl settings and magic.

+1


source


Have you checked PreviousPage for null?

From msdn :



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

Also - MessageBox

in web form, not a great idea ... maybe use the built-in trace.axd

0


source







All Articles