简体   繁体   English

从控制器调用JQuery函数

[英]Call JQuery function From Controller

I am populating dropdown list using JQuery. 我正在使用JQuery填充下拉列表。 whenever i selected any item from that dropdown (ie Drop down selected index change) i want to run an another JQuery Function... Here is my controller.. 每当我从该下拉列表中选择任何项(即下拉所选索引更改)时,我都想运行另一个JQuery函数...这是我的控制器。

   public ActionResult PopulateTest(string Id)
    {
      // Here i want to call the JQuery function
        return PartialView("Details");
    }

and my JQuery Function... 和我的JQuery函数...

 $(function () {
    var a = document.getElementById("HidStatus").value;
    var b = parseInt(a);
    $("#progressbar").progressbar({
        value: b,
        max: 100
    });
});

i think this might be helpful to you..just try this... 我认为这可能对您有帮助。

 public ActionResult PopulateTest(string Id)
{
  // Here i want to call the JQuery function
    page << "foo()" // call your function here after "<<"
  or you can use call method
    page.call:foo();
    return PartialView("Details");
}

here is reference of call method call 这是调用方法调用的参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM