Portal Engine Questions on portal engine and web parts.
Version 7.x > Portal Engine > Too many characters in character literal? View modes: 
User avatar
Member
Member
vcarter - 9/18/2013 9:33:23 AM
   
Too many characters in character literal?
Nested Query Repeater

I was using that as the basis for adding a nested query repeater to my news pages that would display a list of media contacts based on geographical region and associated/relevant business units.

This code:

 <cms:queryrepeater StopProcessing="false" runat="server" ID="qrContacts" QueryName="custom.news.NewsMedia" TransformationName="custom.news.NewsContact" OrderBy="LastName ASC" /> 

<script runat="server">

protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.Parent is IDataItemContainer)
{
IDataItemContainer cont = this.Parent as IDataItemContainer;
if (cont != null)
{
qrContacts.WhereCondition= "nodeAliasPath = '" + Eval("NodeAliasPath") + "'";
qrContacts.ReloadData(true);
}else
{
Response.Write("Error: IDataItemContainer is null");
}
}
}

</script>


Was added to the transformation that displays the news detail. The code in the custom.news.NewsContact transformation is basic display:

<%# Eval('FirstName') %> <%# Eval('LastName') %><br />
<%# Eval('Company') %><br />
<%# Eval('Phone') %><br />
<a href="mailto:<%# Eval('Email') %>"><%# Eval('Email') %></a><br />


If I replace that code with text for testing purposes, it displays correctly, however whenever I have that code in place I get:

error CS1012: Too many characters in character literal


I have checked the query, it returns the correct data, and has been used on a normal, no nested repeater. The error is vague but it seems as if there is a disconnect when trying to load the data dynamically? Is there a setting I am missing? Anyone else ever experience this?

Thank you in advance.

User avatar
Member
Member
Accepted solutionAccepted solution
vcarter - 9/18/2013 10:34:13 AM
   
RE:Too many characters in character literal?
Sigh: Sorry for the wasted post. The problem is this:

<%# Eval('FirstName') %> <%# Eval('LastName') %><br />


Should be:

<%# Eval("FirstName") %> <%# Eval("LastName") %><br />


Single quotes(char), double quotes(string)

Apologies...