1

i've just created a page that needs to update that contains multiple documents. Each document can be selected from a menu on the page.

I would normally wrap this up in a multiview + update panel, however I needed to update the url as well to reflect the document selected.

At the moment I've done this using a different postbackurl (so no update panel), however this means displaying a nasty "Firefox needs to resend...2 message when the back button is clicked.

I could, instead redirect from the button event. This would have the same effect, but without the message.

The question I have is does the postbackurl method offer any significant advantages over the redirect. By advantages I mean performance.

Any thoughts would be appreciated.

dotnetnoob
  • 10,783
  • 20
  • 57
  • 103

2 Answers2

2

Response.Redirect is a simple HTTP 302, so performance-wise it may be 'faster' and 'lighter'.

PostBackURL updates the form's Action, keeping ViewState along with other Page objects. So technically slower performance with more bulk because of the increased latency.

If you want to avoid the re-POST then easiest to use Response.Redirect.

gws2
  • 599
  • 3
  • 8
0

Let us consider the two cases :

  • no postbackurl, with redirect : the client submit the form, the server issues a redirect, the client issues a get request to the final url and gets the content

  • postbackurl : the client submits the form to the postbackurl and gets the content

    Second case is better in terms of performance ( no network roundtrip to get and follow the redirect )

But redirect has some advantages in the fact that a get request is issued. (no reload or repost problem)

Anyway, I was wondering why you couldn't just use HyperLink with NavigateUrl to get to your content.

Community
  • 1
  • 1
jbl
  • 15,179
  • 3
  • 34
  • 101
  • Thanks. In answer to your question, I used a button because originally, I was looking at using a redirect. You are correct in that a hyperlink would do the job given the current requirement. – dotnetnoob Feb 05 '13 at 17:56