HtmlTextWriter.WriteEncodedUrlParameter Method

Encodes the specified URL parameter for the requesting device, and then writes it to the output stream.

Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)

public:
virtual void WriteEncodedUrlParameter (
	String^ urlText
)
public void WriteEncodedUrlParameter (
	String urlText
)
public function WriteEncodedUrlParameter (
	urlText : String
)
Not applicable.

Parameters

urlText

The URL parameter string to encode and write to the output stream.

Spaces in the parameter part of a URL are encoded as plus signs (+), and equal signs (=) are encoded as %3d.

The following code example shows how to use the WriteEncodedUrlParameter method, which generates the following output:

ID%3dCity+State

No code example is currently available or this language may not be supported.
// Assign a value to a string variable
// and encode it to a page as a 
// URL parameter.      
param = "ID=City State";
writer.WriteBreak();
writer.WriteEncodedUrlParameter(param);

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: