HtmlTextWriter.EncodeUrl メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > HtmlTextWriter.EncodeUrl メソッドの意味・解説 

HtmlTextWriter.EncodeUrl メソッド

指定した URL 内の空白文字列を "%20"変換して最小限URL エンコーディング実行します

名前空間: System.Web.UI
アセンブリ: System.Web (system.web.dll 内)
構文構文

解説解説
使用例使用例

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"));
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
HtmlTextWriter クラス
HtmlTextWriter メンバ
System.Web.UI 名前空間
TextWriter
UrlPathEncode
AddAttribute
HttpRequest



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

HtmlTextWriter.EncodeUrl メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



HtmlTextWriter.EncodeUrl メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS