How to redirect to action from JavaScript method?

前端 未结 8 1981
孤城傲影
孤城傲影 2020-12-25 11:12

I have an input type=\"button\"


8条回答
  •  执笔经年
    2020-12-25 11:52

    I struggled with this a little because I wanted to use Knockout to bind the button to the click event. Here's my button and the relevant function from inside my view model.

    Back to Dashboard
    
    var vm = function () {
    ...
        self.back = function() {
            window.location.href = '@Url.Action("LicenseDashboard", "Application")';
        }
    }
    

提交回复
热议问题