.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘querystring’

Description of the documentation error in the “HttpServerUtility.Transfer Method (String, Boolean)” topic in the Microsoft Developer Network

Symptoms
This article describes the undocumented change in behavior of the HttpServerUtility.Transfer method call from the Microsoft .NET Framework 1.0 to the Microsoft .NET Framework 1.1.
For more information, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa332847(VS.71).aspx(http://msdn2.microsoft.com/en-us/library/aa332847(VS.71).aspx)
Resolution
The HttpServerUtility.Transfer method contains two parameters. The first parameter is a URL path of the new page on the server to execute.The second optional parameter indicates whether the Form and the QueryString values can pass from the calling page to the page that the user is being transferred to.

HttpServerUtility.Transfer(String, Boolean); In the .NET Framework 1.0, if the second optional parameter of the HttpServerUtility.Transfer method is not specified, the second parameter is set to false.
In the .NET Framework 1.1, if the second optional parameter of the HttpServerUtility.Transfer method is not specified, the second parameter is set to true.
The “Parameters” section of the “HttpServerUtility.Transfer Method (String, Boolean)” topic in MSDN states the following:
path
The URL path of the new page on the server to execute.
preserveForm
If true, the QueryString and Form collections are preserved. If false, they are cleared. The default is false.
The following is the correct information:
path
The URL path of the new page on the server to execute.
preserveForm
If true, the QueryString and Form collections are preserved. If false, they are cleared. In the .NET Framework 1.0, the default value of the preserveForm parameter is false. In the .NET Framework 1.1, the default value of the preserveForm parameter is true.

BUG: FIX: VBScript Can Corrupt Data Stored in Scripting Dictionary Object

Symptoms
If you assign Request.Form or QueryString items in a Scripting Dictionary object cached in Session scope, you will corrupt your data. Corrupted data will manifest either as empty fields (that is, blank individual dictionary items) or as items containing garbage text.
Resolution
VBScript does not use IDispatch to fetch the Response object’s default property. This results in an object reference being assigned to an Item in the Dictionary (even when the assignment in your script does not use the Set statement). When this object reference is then cached with Session scope, a related bug in Active Server Pages (ASP) doesn’t catch and block the object reference (see 216825?(http://support.microsoft.com/kb/216825/EN-US/) “BUG: Assignment of Multi-valued Objects in Request Object Causes Corruption in Scripting Dictionary” for details).

BUG: Assignment of Multi-Valued Objects in Request Object Causes Corruption in Scripting Dictionary

Symptoms
If items in the Request.Form or Request.QueryString collections that contain multiple values are assigned to a Scripting Dictionary object stored in the Session object, data corruption may occur. Corrupted data will manifest either as empty fields (that is, blank individual dictionary items) or items that contain garbage text.
A common example of this is a checkbox; checkbox controls can have the same name so that multiple values of a single named item can be returned to the server.
Resolution
When the assignment of a multi-valued item in the Request.QueryString or Request.Form collections to an item in the Scripting Dictionary object takes place without explicitly using the Item property of the object within the collection, a reference to the actual object is stored in the Scripting Dictionary instead of the intended value. This means that when the item stored in the Scripting Dictionary is referenced again, the Scripting Dictionary will refrence an object in the Request.QueryString or Request.Form collections instead of the intended string or integer values.