HtmlTextWriter.EncodeUrl メソッド
アセンブリ: System.Web (system.web.dll 内)

Dim url As String Dim returnValue As String returnValue = Me.EncodeUrl(url)
戻り値
エンコードされた URL を格納している文字列。

文字の URL エンコーディングは、パーセント記号 (%) の後にその文字に対する ISO-Latin コード ポイントの 2 桁の 16 進数表現 (大文字と小文字を区別しない) が続く形式で表されます。空白文字の 16 進数表現は 20 です。

EncodeUrl メソッドを呼び出して、AddAttribute メソッド呼び出しでパラメータとして渡された URL 内のすべての空白文字列を変換する方法を次のコード例に示します。
' If an <anchor> element is rendered and an href ' attribute has not been defined, call the AddAttribute ' method to add an href attribute ' and set it to http://www.cohowinery.com. ' Use the EncodeUrl method to convert any spaces to %20. If TagKey = HtmlTextWriterTag.A Then If Not IsAttributeDefined(HtmlTextWriterAttribute.Href) Then AddAttribute("href", EncodeUrl("http://www.cohowinery.com")) End If End If
// If an <anchor> element is rendered and an href // attribute has not been defined, call the AddAttribute // method to add an href attribute // and set it to http://www.cohowinery.com. // Use the EncodeUrl method to convert any spaces to %20. if (TagKey == HtmlTextWriterTag.A) { if (!IsAttributeDefined(HtmlTextWriterAttribute.Href)) { AddAttribute("href", EncodeUrl("http://www.cohowinery.com")); } }
// If an <anchor> element is rendered and an href // attribute has not been defined, call the AddAttribute // method to add an href attribute // and set it to http://www.cohowinery.com. // Use the EncodeUrl method to convert any spaces to %20. if ( TagKey == HtmlTextWriterTag::A ) { if ( !IsAttributeDefined( HtmlTextWriterAttribute::Href ) ) { AddAttribute( "href", EncodeUrl( "http://www.cohowinery.com" ) ); } }
// If an Anchor element is being rendered and an href // attribute has not been defined, call the AddAttribute // method to add an href // attribute and set it to http://www.cohowinery.com. // Use the EncodeUrl method to convert any spaces to %20. if (get_TagKey().Equals(HtmlTextWriterTag.A)) { if (!(IsAttributeDefined(HtmlTextWriterAttribute.Href))) { AddAttribute("href", EncodeUrl("http://www.cohowinery.com")); } }

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
UrlPathEncode
AddAttribute
HttpRequest
Weblioに収録されているすべての辞書からHtmlTextWriter.EncodeUrl メソッドを検索する場合は、下記のリンクをクリックしてください。

- HtmlTextWriter.EncodeUrl メソッドのページへのリンク