inicio mail me! sindicaci;ón

Asp.net jumps turn 3 kinds of methods of the page are compared

The teacher told 3 kinds to jump today turn the method of the page, summary is as follows now:

1 Response.redirect This jumps turn the method of the page jumps the speed that turn is unhappy, because it wants 2 to make a round trip (2 Postback) , but he can jump Turn to any pages, restrict without site page (can jump to sina with You Yahu) , cannot jump over entry protection at the same time. But rate is slow it is its the biggest drawback! Redirect jumps a favourable turn makes: It is to send a Http to request to be carried to the client above all, the announcement needs to jump turn to new page, next client end is in send jump turn the request is carried to the server. Those who need an attention is to jump all data information that after turning, interior space saves will be lost, so need uses Session.

2 Server.transfer Rate is rapid, need Postback only, but. . . . He must be to be in same below the site, because it is a method of Server. Additional, he can jump over entry protection. You can write a small order to try: The design arrives by the page page of 2 jump turn, but should enter a page 2 need login, form attestation, but if jump,turn if the statement uses Transfer, that won’t flip an entry page. The heavy directional request of this method is to happen in server end, what so the Url address of the browser still withholds is the address of former page!

3 Sever.execute This method basically is to be used in the page above the design, and he must be to jump turn the page below same site. This method is need when inserting the output of a page another Aspx page as a result, use, it is to be in form for the most part, the means consist in that certain the page is similar to nest another page.

Summary:

Jump the user when need when turning to the page on another server Use Redirect

Jump the user when need turn to be not Aspx page moment, be like Html Use Redirect

When when need regards one part of Url as inquiry string, reservation passes a server, because other 2 kinds of methods cannot accomplish Postback 2 times, bring back data first server Use Redirect

  The changeover between need Aspx page (do not involve login) Use Transfer

When the output that should need an Aspx page inserts another Aspx page as a result, use Execute method.

Of course, forgot to still one exceeds a link! Of course this does not need to tell too much. He is in the party need user decides when to jump turn page, use exceed a link.

   Carry incidentally, how to use Redirect method to use a Chinese character in inquiring string, because often the circumstance is occurrence chaos code, the reason is Url does not support a Chinese character. This moment needs transition:

   String Message =server.urlencode(” welcomes to race column ” );

Change first, using inquiry string

Response.redirect(”webform2.aspx? Msg=” message);

Bookmark:Digg Del.icio.us Reddit

Leave a Comment