ASP.NET Performace
-
Two questions: 1- I was running a performer to see how long funtions take in my ASP.NET Web App. Shows that some Server.Transfer are really slow! Is it better to use Response.Redirect than Server.Transfer? I would thought that Server.Transfer does not need to go back to the client, so should be faster than Response.Redirect, any idea?? 2 - I am using many DataGrids and normally I use SqlDataReaders or DataTables, when I use DataTables I normally called DataTable.Dispose() after DataGrid.DataBind() so calls the garbage collection. But again looks like calling GC takes a big hit in performance, should I stop using Dispose()?? Ideas?
-
Two questions: 1- I was running a performer to see how long funtions take in my ASP.NET Web App. Shows that some Server.Transfer are really slow! Is it better to use Response.Redirect than Server.Transfer? I would thought that Server.Transfer does not need to go back to the client, so should be faster than Response.Redirect, any idea?? 2 - I am using many DataGrids and normally I use SqlDataReaders or DataTables, when I use DataTables I normally called DataTable.Dispose() after DataGrid.DataBind() so calls the garbage collection. But again looks like calling GC takes a big hit in performance, should I stop using Dispose()?? Ideas?
- Server.Transfer works as a kind of server-side redirect. It terminates the execution of the current page and passes control to the specified page. Unlike Server.Execute, control is not passed back to the caller page. It is more effective than Response.Redirect. However, If you use Server.Transfer to transfer a user to another page, ensure that the currently authenticated user is authorized to access the target page. If you use Server.Transfer to a page that the user is not authorized to view, the page is still processed. Server.Transfer uses a different module to process the page rather than making another request from the server, which would force authorization. Do not use Server.Transfer if security is a concern on the target web page. Use HttpResponse.Redirect instead. p.s. That is the information i read from "Programming Microsoft ASP.NET" and "Improving Web Application Security: Threats and Countermeasures" 2) I never call Dispose...I like ASP decide when to do clean up.
-
- Server.Transfer works as a kind of server-side redirect. It terminates the execution of the current page and passes control to the specified page. Unlike Server.Execute, control is not passed back to the caller page. It is more effective than Response.Redirect. However, If you use Server.Transfer to transfer a user to another page, ensure that the currently authenticated user is authorized to access the target page. If you use Server.Transfer to a page that the user is not authorized to view, the page is still processed. Server.Transfer uses a different module to process the page rather than making another request from the server, which would force authorization. Do not use Server.Transfer if security is a concern on the target web page. Use HttpResponse.Redirect instead. p.s. That is the information i read from "Programming Microsoft ASP.NET" and "Improving Web Application Security: Threats and Countermeasures" 2) I never call Dispose...I like ASP decide when to do clean up.
That's what I thought, Server.Transfer was better than Response.Redirect, however my trace and the program ANTS don't agree with that statement, shows me the Server.Transfer takes longer than Response.Redirect + loading the page. Pretty confusing !! Thanks Albert