Quantcast
Channel: C1 CMS Foundation - Open Source on .NET
Viewing all articles
Browse latest Browse all 2540

New Post: Composite C1 MvcPlayer render fails when containing a Url.Action with a 'Page' parameter

$
0
0
Sorry, this is actually a duplicate of a question I asked in StackOverflow, but it looks like this discussions forum is far more active than the StackOverflow posts.

http://stackoverflow.com/questions/15640591/composite-c1-mvcplayer-render-fails-when-containing-a-url-action-with-a-page-p

I have a View which fails to render by the MvcPlayer function of Composite. Through a process of elimination I was able to track it down to the following line in the View:
Url.Action("Action", "Controller", new { Page = 123, PageSize = 180 });
I then went further and discovered that if I changed it to the following:
Url.Action("Action", "Controller", new { PageSize = 180 });
The page then renders with no issues.

I checked the Composite error log, which stated:
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
I know in Composite you reference pages within the system like so:
<a href="/page(@aPage.Data.Id)">Page</a>
The output of my Url.Action is /Controller/Action?Page=123&Page=180

So I assume that composite is picking up on the "?Page=123" part of the URL result from the Action and then is trying to process it as a composite Page reference, which of course it isn't.

Does anyone know how I could get around this issue?

Viewing all articles
Browse latest Browse all 2540

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>