サーチ…


構文

  • public static string GetItemUrl(アイテムアイテム)
  • パブリック静的文字列GetItemUrl(アイテムアイテム、UrlOptionsオプション);

アイテムのURLを取得する

シンプルなサイトコレクションアイテムがあれば:

Item item;

アイテム自体にURLが含まれていません。アイテムのURLを取得するには、 staticクラスSitecore.Links.LinkManager呼び出す必要があります

string url = LinkManager.GetItemUrl(item);

これのオーバーロードはUrlOptionsクラスを受け入れます:

UrlOptions options = new UrlOptions
{
     AddAspxExtension = false
     ....
};
string url = LinkManager.GetItemUrl(item, options);


Modified text is an extract of the original Stack Overflow Documentation
ライセンスを受けた CC BY-SA 3.0
所属していない Stack Overflow