Bootstrap 4 模态 div 带 ID(来自 C# 模型的 Guid)
Bootstrap 4 modal div with ID (Guid from C# model)
所以基本上如果我选择:
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#@Model.ID">
<div class="modal fade" id="@Model.ID" tabindex="-1" role="dialog" aria-labelledby="CenterTitle"" aria-hidden="true">
它不有效! (ID 为 public Guid ID { get; set; })
按钮不打开模态 window.
如果我手动更改为
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#id11">
<div class="modal fade" id="id11" tabindex="-1" role="dialog" aria-labelledby="CenterTitle"" aria-hidden="true">
有效吗?有什么想法吗?
问题是 Guid 值有时以数字开头,这是 CSS 的问题。
所以基本上如果我选择:
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#@Model.ID">
<div class="modal fade" id="@Model.ID" tabindex="-1" role="dialog" aria-labelledby="CenterTitle"" aria-hidden="true">
它不有效! (ID 为 public Guid ID { get; set; }) 按钮不打开模态 window.
如果我手动更改为
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#id11">
<div class="modal fade" id="id11" tabindex="-1" role="dialog" aria-labelledby="CenterTitle"" aria-hidden="true">
有效吗?有什么想法吗?
问题是 Guid 值有时以数字开头,这是 CSS 的问题。