Some of the common methods of passing data between pages (web forms) are:
1. Query String
2. Session Variables
3. Server.Transfer
Querystring and Session variables has its own limitations. ( For example, you can't pass objects or sensitive data using Query string method. More over there are limitations on number of characters which can be passed on a URL etc.,). So Server.Transfer is the better method for passing data across pages.
Note: If you use Server.Transfer inside a Try..Catch Block it would throw an ThreadAbortException. Its not a bug that's how they have designed it to clean up the Stack :) In order to overcome that either opt for Server.Execute or Response.Redirect('page.aspx', false).
1. Query String
2. Session Variables
3. Server.Transfer
Querystring and Session variables has its own limitations. ( For example, you can't pass objects or sensitive data using Query string method. More over there are limitations on number of characters which can be passed on a URL etc.,). So Server.Transfer is the better method for passing data across pages.
Note: If you use Server.Transfer inside a Try..Catch Block it would throw an ThreadAbortException. Its not a bug that's how they have designed it to clean up the Stack :) In order to overcome that either opt for Server.Execute or Response.Redirect('page.aspx', false).
Comments