如何在Jquery中打开弹出窗口时将参数传递给操作

时间:2013-06-25 10:59:55

标签: jquery

我有

public actionresult GAccess(String selectedIDs){
    //do some code witht he selected ids    
    return partialview("GAccess",model);
}

$("ownedButton").click function(){
    $("owneddialog").data("selectedIDs","1,2,3").dialog("open");
}

$("owneddialog").dialog({
    open:function(){    
        //I want to load the url with the parameter.  please suggest
    }
})

1 个答案:

答案 0 :(得分:0)

确保您的选择器正确无误,$(this).data('selectedIDs')应该返回数据。 This fiddle表明它有效。也许您的问题是=位中的new {selectedIDs = $(this).data('selectedIDs')}符号?不应该是:吗?