gpt4 book ai didi

javascript - 类(class)未申请Link

转载 作者:行者123 更新时间:2023-12-03 04:19:00 25 4
gpt4 key购买 nike

这里我对这个类使用 anchor 标记不适用。这是我的代码

 <td> <a href="@Url.Action("ViewServiceDetails", "ServiceConsumer", new { BookingID = CAH.BookingID, @class = "btn btn-link", data_toggle = "modal", data_target = "#ViewServiceDetails" })">@CAH.BookingID</a></td>  

以前我用过

<td> @Html.ActionLink((string)CAH.BookingID, "ViewServiceDetails", "ServiceConsumer", new { BookingID = CAH.BookingID }, new { @class = "btn btn-link", data_toggle = "modal", data_target = "#ViewServiceDetails" })</td>  

但我在第二个时遇到错误

最佳答案

你的做法是错误的。您会与“普通”HTML 和帮助程序混淆。

您不会将 @class 属性传递给传递给 Url.Action 的匿名对象

如果您愿意,只需将普通 HTML 与 Url.Action 结合使用即可:你的做法是错误的。您会与“普通”HTML 和帮助程序混淆。

您不会将 @class 属性传递给传递给 Url.Action 的匿名对象

如果需要,只需将普通 HTML 与 Url.Action 结合使用即可:

 <td> 
<a href="@Url.Action("ViewServiceDetails", "ServiceConsumer", new { BookingID = CAH.BookingID })"
class="btn btn-link"
data-toggle="modal"
data-target="#ViewServiceDetails">
@CAH.BookingID
</a>
</td>

您可以按照描述使用 Html.ActionLink here

@Html.ActionLink(CAH.BookingID,  // <-- Text of link.
"ServiceConsumer", // <-- Controller Name.
"ViewServiceDetails", // <-- ActionMethod
new { BookingID = CAH.BookingID }, // <-- Route arguments.
new { @class="btn btn-link", data_toggle = "modal", data_target = "#ViewServiceDetails" } // <-- htmlArguments
)

关于javascript - 类(class)未申请Link,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44027296/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com