更新しました
この問題は無視してください。私は完全に誤解していました。問題は私が思っていたものとは何の関係もありませんでしたが、Composite が関数からレンダリングするすべての html を XML として処理するため、特定のエスケープが必要です。文字 (ここに便利なリファレンスがあります: http://www.faqs.org/docs/htmltut/characterentities_famsupp_69.html )。私の場合、に置き換える必要が&
ありました&
。
この情報が他の誰かに役立つことを願っています。
また、文字列をエスケープする方法についての素晴らしい投稿があります: XML への文字列エスケープ
私の古い誤解の問題:
Composite の MvcPlayer 関数でレンダリングに失敗するビューがあります。消去のプロセスを通じて、ビューの次の行まで追跡することができました。
Url.Action("Action", "Controller", new { Page = 123, PageSize = 180 });
次にさらに進んで、次のように変更した場合に発見しました:
Url.Action("Action", "Controller", new { PageSize = 180 });
その後、ページは問題なくレンダリングされます。
Composite エラー ログを確認したところ、次のように記載されていました。
System.Xml.XmlException: '=' is an unexpected token. The expected token is ';'. Line 81, position 63.
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken1, String expectedToken2)
at System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(Int32 pos, String expectedToken)
at System.Xml.XmlTextReaderImpl.HandleEntityReference(Boolean isInAttributeValue, EntityExpandType expandType, Int32& charRefEndPos)
at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
at System.Xml.XmlTextReaderImpl.ParseAttributes()
at System.Xml.XmlTextReaderImpl.ParseElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
at System.Xml.Linq.XDocument.Parse(String text)
at Composite.AspNet.MvcPlayer.Functions.RenderInternal(String path) in c:\***************\MvcPlayer\Player.cs:line 125
Composite では、システム内のページを次のように参照していることを知っています。
<a href="/page(@aPage.Data.Id)">Page</a>
私の Url.Action の出力は /Controller/Action?Page=123&Page=180 です
したがって、複合はアクションからの URL 結果の「?Page=123」部分を取得し、それを複合ページ参照として処理しようとしていると想定していますが、もちろんそうではありません。
この問題を回避する方法を知っている人はいますか?