Hi,
What is the difference between Server.Transfer VS server.Execute in ASP.NET.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Aug 29, 2011, 7:33 AM
If this post helps you mark it as answer
Thanks
Satyapriya NayakPosted Aug 16, 2011, 11:42 AM
Server. Transfer takes the control execution of the page to the new page and thereafter it doesn't return automatically to the original page.
The transfer happens at the server side and the client browser is not aware of the change and hence will not update the URL.
Server. Execute actually executes the specified page and then returns back to the original page. This can be used in scenarios where you want to go to a specific page, execute some thing and then come back to the original page.
In the attached program we will see that when we click transfer button url is not changed but it goes to the transfer.aspx.when we click execute button here also url is not changed but the controls such as textbox and two button are seen with respect to the label control which is present in the execute.aspx page.Thanks
If this post helps you mark it as answer