简体   繁体   English

服务器标签格式不正确-ID中的Eval错误

[英]Server Tag is not well formed - Error with Eval in ID

I am having an issue with my Asp.NET app, in the HTML section, basically the issue comes from the EVAL value which is the "Id" properly, so I've tried using an RadioButton and Input, but any of them work properly. 我的Asp.NET应用程序有一个问题,在HTML部分中,基本上该问题来自正确的EVAL值,即“ Id”,因此我尝试使用RadioButton和Input,但它们中的任何一个都可以正常工作。

This is my Asp.NET code. 这是我的Asp.NET代码。

<div class="row justify-content-center">
    <div class="col-lg-3">
        <div class="item">
            <input runat="server" id="AnswerID<%# Eval("Id") %>_Nunca" type="radio" name="GrupID<%# Eval("Id") %>" value="Company" class="required">
            <label for="AnswerID<%# Eval("Id") %>_Nunca">
                <img src="Content/img/seo_icon_1.svg" alt="">
                <strong>Nunca</strong>No, Nunca
            </label>
        </div>
    </div>

    <div class="col-lg-3">
        <div class="item">
            <input runat="server" id="AnswerID<%# Eval("Id") %>_Aveces" name="GrupID<%# Eval("Id") %>" type="radio" value="Private User" class="required">
            <label for="AnswerID<%# Eval("Id") %>_Aveces">
                <img src="Content/img/seo_icon_2.svg" alt="">
                <strong>A veces</strong>Si, Algunas veces
            </label>
        </div>
     </div>

    <div class="col-lg-3">
        <div class="item">
            <input runat="server" id="AnswerID<%# Eval("Id") %>_Siempre" name="GrupID<%# Eval("Id") %>" type="radio" value="Private User" class="required">
            <label for="AnswerID<%# Eval("Id") %>_Siempre">
                <img src="Content/img/seo_icon_3.svg" alt=""> 
                <strong>Siempre</strong>Si, Siempre
            </label>
        </div> 
    </div>
</div>

This is the error: 这是错误:

Server Tag is not well formed. 服务器标签格式不正确。

I am not sure what's the issue, I have seen several similar questions, but no gives a real answer. 我不确定是什么问题,我已经看到了几个类似的问题,但是没有给出真正的答案。

Thanks in advance. 提前致谢。

I haven't done this in ages, but it looks like you have the double quotes nested. 我已经很久没有这样做了,但是看起来您已经嵌套了双引号。 Try changing some of them to single quotes. 尝试将其中一些更改为单引号。

Try 尝试

 <div class="item">
                <input runat="server" id="Radio1" type="radio" name='GrupID<%# Eval("Id") %>' value="Company" class="required"/>
                <label for="AnswerID<%# Eval("Id") %>_Nunca">
                    <img src="Content/img/seo_icon_1.svg" alt=""><strong>Nunca</strong>No, Nunca</label>
            </div>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM