gpt4 book ai didi

c# - 更改@html.DropDownList值时显示警告框

转载 作者:行者123 更新时间:2023-11-28 08:14:18 24 4
gpt4 key购买 nike

  @Html.DropDownListFor(model => model.Status, new List<SelectListItem> 
{ new SelectListItem{Text="Active", Value="1",Selected =true},
new SelectListItem{Text="Deactive", Value="0"}})

如果我将值“Active”更改为“De active”,则会显示一个警报框。如何显示警告框。

最佳答案

您可以使用 Jquery 中的change() 处理程序来监听该事件。

$( "#targetId").change(function() {
alert( "Something changed handle it here" );
});

http://api.jquery.com/change/

关于c# - 更改@html.DropDownList值时显示警告框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23801796/

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