如何在MVC中刷新当前页面.
[HttpGet]
public ActionResult Request()
{
if (Session["type"] != null && Session["resulttype"] != null)
{
return View();
}
else
{
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
我想在其他部分刷新我的页面.那是返回null值的时候.
我想在web api GET和POST方法中将对象作为参数传递.我的代码是,
[HttpGet]
[Route("mytest/list/{model}")]
public IHttpActionResult GetAllTypes(TestModel model)
{
//my logic here
}
Run Code Online (Sandbox Code Playgroud)
当我调用它时,控制台会收到错误,但未找到错误.我试过这个,
[HttpGet]
[Route("mytest/list/{model?}")]
public IHttpActionResult GetAllTypes(TestModel model)
{
//my logic here
}
Run Code Online (Sandbox Code Playgroud)
但是,参数对象获取空值.
我是wpf和MVVM的新手,我花了一整天的时间试图在SelectionChanged上将ComboBox的值赋予我的ViewModel.我想在选择更改过程中调用一个函数.在mvvm中,它的解决方案是什么?