differnce between
-
differnce between these response.redirect("login.page"); server.transfer("login.page"); asap
-
differnce between these response.redirect("login.page"); server.transfer("login.page"); asap
-
differnce between these response.redirect("login.page"); server.transfer("login.page"); asap
Server.Transfer is often a better choice than Response.Redirect. Example:Let's say you're on A.aspx and you want to send the user to B.aspx. Response.Redirect flow A.aspx calls Response.Redirect("B.aspx",false); which sends a 302 redirect header down to the client browser, telling it that the asset it has requested (A.aspx) has moved to B.aspx, and the web application terminates. The client browser then sends a request to the webserver for B.aspx. IIS tells asp_wp.exe to process the request. asp_wp.exe (after checking authentication and doing all the other setup stuff it needs to do when a new request comes in) instantiates the appropriate class for B.aspx, processes the request, sends the result to the browser, and shuts down. Server.Transfer flow A.aspx calls Server.Transfer("B.aspx");. ASP.NET instantiates the appropriate class for B.aspx, processes the request, sends the result to the browser, and shuts down. Note that Server.Transfer cuts the load on the client and the server. Server.Transfer is easier to code for, too, since you maintain your state. Information can be passed through the HTTP Context object between the pages, eliminating the need to pass information in the querystring or reload it from the database.
Regards, Satips.:rose:
-
differnce between these response.redirect("login.page"); server.transfer("login.page"); asap
response.redirect(""); In this method the redirection to the page is sent to the browser. From the browser it is redirected to the page. i.e Process goes like this Server -> client(browser) -> Server -> client(browser) set redirect the page Page is loaded redirect command to the browser server.transfer(""); In this method the redirection to the page is done in server, so the redirect page is sent to the browser i.e Process goes like this Server -> Server -> Client(browser) Transfer transfer Page is loaded the page page is sent Note:- So response.redirect("") does call to client and then to server for loading , server.transfer("") does not call to client, but transfer in the server and load that page to the client