Home Razor Syntax. Disable Compile Warning for "Element 'summary' can appear no more than 1 time(s) inside element 'details'"
Reply: 1

Razor Syntax. Disable Compile Warning for "Element 'summary' can appear no more than 1 time(s) inside element 'details'"

RitchieD
1#
RitchieD Published in 2017-09-12 14:39:13Z

How can I disable Visual Studio Compile Warning for HTML "Element 'summary' can appear no more than 1 time(s) inside element 'details'"?

Or how can I find the pragma warning number to surround the code in pragma warning disable and pragma warning restore?

            <details id="Hearing_Audition" @Html.TabOpen("Hearing_Audition", (string)ViewBag.Tab)>
                @if (Model.Definition.SchedulingIndicator)
                {
                    <summary>@Resources.TabScheduling</summary>
                }
                else
                {
                    <summary>@Resources.TabHearing</summary>
                }
                @Html.Partial("_EditScheduledHearing")
            </details>
Erik Philips
2#
Erik Philips Reply to 2017-09-12 15:01:00Z

Put the if inside the summary:

         <summary>
         @if (Model.Definition.SchedulingIndicator)
            {
                <text>@Resources.TabScheduling</text>
            }
            else
            {
                <text>@Resources.TabHearing</text>
            }
         </summary>
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.322574 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO