Ramco Ramco

Ramco Ramco

  • 442
  • 3.4k
  • 516.7k

Syntax error ',' expected.

Aug 30 2024 6:12 AM

Hi

  I am getting error after writing below code - Syntax error ',' expected. The name address1,address2 does not exists in the current context.

                        htmlTable.Append("<a id='btnEdit' class='list-icons-item text-primary-600' data-toggle='modal' data-backdrop='static' data-keyboard='false' data-address1='{row["address1"]}' data-address2='{row["address2"]}' data-target='#modal_form_horizontal' onclick='BindData(this);'><i class='icon-pencil7 mr-1'></i></a>");

htmlTable.Append("<td class='text-center'>");
    htmlTable.Append("<a id='btnEdit' class='list-icons-item text-primary-600' data-toggle='modal' data-backdrop='static' data-keyboard='false' data-address1='{row["address1"]}' data-address2='{row["address2"]}' data-target='#modal_form_horizontal' onclick='BindData(this);'><i class='icon-pencil7 mr-1'></i></a>");

    string deleteAttributes = Status == "Blocked" ? "style='pointer-events: none; opacity: 0.5;' onclick='return false;'" : "data-toggle='modal' data-target='#modal_Delete' ";
    htmlTable.Append($"<a id='btnDel' class='list-icons-item text-danger-600' { deleteAttributes}><i class='icon-bin mr-1'></i></a>");

    htmlTable.Append("</td>");

    htmlTable.Append("<td style='display:none'>" + row["docentry"] + "</td>");
    htmlTable.Append("</tr>");
    Count++;
}
htmlTable.Append("</tbody>");
htmlTable.Append("</table>");
PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });

Thanks


Answers (2)