小编Kav*_* P.的帖子

如何在 jquery 中启用/禁用按钮?

我的代码看起来像,

$("#OperationTypeId").change(function () {
var DropdownSelectionValue = $("#OperationTypeId :selected").val();
    alert(DropdownSelectionValue );
    if (DropdownSelectionValue == 3)
        {
            $("#Button1Id").attr('disabled');
            $(" Button2Id").attr('enable');;
            //$("#Button1Id").hide();
        }
        else {
            $("#Button1Id").attr('enable');
            $(" Button2Id").attr('disabled');;
        }
});
Run Code Online (Sandbox Code Playgroud)

我的代码正确显示警报值,但没有使按钮在 DropdownSelectionValue 的条件下启用/禁用。作为初学者,我不知道该怎么做。请告诉我。

model-view-controller jquery razor

5
推荐指数
2
解决办法
2万
查看次数

如何在C#中将值作为url传递

我已经指定了,

@foreach (int ans in Model.UnAnsweredList)
{
    <a href="/Dashboard/GoToAnswer?@ans/">@ans</a>
}
Run Code Online (Sandbox Code Playgroud)

和它的get方法给出,

 public ActionResult GoToAnswer(int? number)
Run Code Online (Sandbox Code Playgroud)

即使ans是int类型,该值也不会传递给方法.请告诉我该怎么做.

c# asp.net-mvc

2
推荐指数
1
解决办法
144
查看次数

如何为IDictionary <int,string>创建实例?

我有我的模特,

public IDictionary<int, string> QuestionSetList { get; set; }
Run Code Online (Sandbox Code Playgroud)

我不能在我的控制器中使用这个QuestionSetList,当它执行时,它抛出一个NullReferenceException,说:对象引用没有设置为对象的实例.我有我的代码,

model.QuestionSetList.Add(QuestionSetNo,QuestionSetTopic);
Run Code Online (Sandbox Code Playgroud)

请告诉我如何解决这个问题.

c# asp.net-mvc razor

0
推荐指数
1
解决办法
1213
查看次数

标签 统计

asp.net-mvc ×2

c# ×2

razor ×2

jquery ×1

model-view-controller ×1