2017-12-22 29 views
0

RESOLVEDATAMACROエラーを取得し続けています。私たちは以下のコードのような静的なhtmlウェブの部分にマクロを持っており、何が間違っているのか分かりません。期待通りに動いているので混乱しています。構文が間違っていますか?誰かが私を助けることができると願っています。マクロは機能していますが、私達は私達のページのいずれかにMACRORESOLVERエラーのトンを取得していると私はそれがどこから来ている突き止めることができました

<div class="row"> 
    <div class="col-sm-4 newsltr-two-btn"> 
    {% if(!String.IsNullOrEmpty(Document)) { %} 
    <a target="_blank" href="~/getattachment/{% Document %}/attachment.aspx" download>{% DocumentText %}</a> 
    {% } else if (!String.IsNullOrEmpty(ExternalDocumentUrl)) { %} 
    <a target="_blank" href="{% ExternalDocumentUrl %}">{% DocumentText %}</a> 
    {% } #%} 
    </div>  
</div> 

イベントログ:

エラー発現評価中:IF(!string.IsNullOrEmpty(ドキュメント)){プリント(ResolveMacros( "\ r \ nの{%DocumentText%} \ Rを\ n")を)}それ以外の場合){印刷(ResolveMacros( "\ rを\ nは{%DocumentText%} \ rを\ n" は))}(string.IsNullOrEmpty(ExternalDocumentUrl!)|(ユーザー)パウロ|(ハッシュ)

7b864efc818f93934b7bfb4c7d92234dc8c506e841ed30c3b661f8bee604d86b System.ArgumentOutOfRangeException:インデックスが範囲外でした。負でなく、コレクションのサイズより小さくなければなりません。 パラメータ名:CMS.MacroEngine.ExpressionEvaluator.EvaluateConditionでSystem.ThrowHelper.ThrowArgumentOutOfRangeExceptionでインデックス (ExceptionArgument引数、ExceptionResourceリソース) (ブール&一致、ブール& securityPassed、DataRowをdrLogItem、DateTimeのevaluationStarted)

答えて

3

があなたのように見えます構文に誤りがあります。あなたは、静的なHTMLのWebパーツを使用している場合、私は、静的なテキストWebパーツに移動をお勧めしたい、また

<div class="row"> 
    <div class="col-sm-4 newsltr-two-btn"> 
    {% if(!String.IsNullOrEmpty(Document)) { %} 
    <a target="_blank" href="~/getattachment/{% Document %}/attachment.aspx" download>{% DocumentText %</a> // your error is here, missing a closing curly brace after the percent sign for DocumentText 
    {% } else if (!String.IsNullOrEmpty(ExternalDocumentUrl)) { %} 
    <a target="_blank" href="{% ExternalDocumentUrl %}">{% DocumentText %}</a> 
    {% } #%} 
    </div>  
</div> 

:以下の表記法を参照してください。静的テキストであるという理由は、入力したHTMLを検証して訂正しません。これは、WYSIWYGエディタがマークアップを変更して問題を引き起こしているという問題でもあります。

+0

応答してくれてありがとうございましたが、これは誤植でした。私はそれを訂正した。 – masterlopau

+0

@masterlopau更新された回答を参照してください。 –

+0

私は静的なウェブ部分をテキストで試しましたが、運はありませんでした。私がやったことは、リピータのWebパーツを使用してASCX変換を使用できることです。 Brendenありがとう! – masterlopau

関連する問題

 関連する問題