Form Concepts CodeSample - Transfering context to another form

From Visual WebGui Wiki

Jump to: navigation, search


Contents

Overview

This article is a part of Form Concepts series of articles.

Why use Context.Transfer

Performing Context.Transfer to another form is prefered over a Context.Redirect for a few reasons.

  • In terms of efficiency, Context.Transfer is significantly more efficient that Context.Redirect. The reason for it is that it processed within the same request context and allthough it is effectively transfering to a new mainform, it does not create a new Context.
  • Less memory overhead as you use the same context and the server side does not have to create a new one
  • You preserve all the context variables you have saved
  • Target form (being transfered to) does not have to be available as application entry point (MainForm).

Why Context.Redirect is less prefered

Context.Redirect is a complete redirection to another mainform, which requres a new Context to be created, which both takes more time and resources. In addition, Context.Redirect requires that the form redirected to has to be available as application entry point (MainForm).

VB.NET Code

Context.Transfer(New SlaveForm)

C# Code

Context.Transfer(New SlaveForm);


Personal tools