我想知道是否有办法做类似 webforms 的事情 .. 或者一个很好的方法来做到这一点 .. 我的“索引”视图上有一个 ActionLink("foo", "fooAction")。在这个 fooAction 中,我调用了一个返回“True”或“False”的方法,根据返回,我必须给用户一些反馈,并返回具有相同结果的“索引”+反馈。
在网络表单中,我们只需在方法上设置“label.visible = true; | label.text = 'bla'”或 w/e。
我清楚了吗?谢谢 !
编辑:
一些伪代码我会使用 webforms 来更好地解释:
<asp:button OnCommand="method1">
- Method1(){
var response = ws.MethodFromWebService(); //call a method from the Web Service and get the return(true/false)
if (response)
feedbackLabel.Text = "worked";
else
feedbackLabel.Text = "didn't work";
feedbackLabel.Visible = true;
}
我想在没有 javascript 的情况下做到这一点。