我有以下问题:
在按钮上单击我将一些数据发送到服务器.我的控制器Action看起来像这样:
public ActionResult Accept(List<MyViewModel> entries)
{
//here entries HAS 2 MyViewModel-Instances in it.
//The entries are not null, but the values of the instances are!
//entries[0].ParamA is null
}
Run Code Online (Sandbox Code Playgroud)
MyViewModel的位置如下:
public class MyViewModel
{
public string ParamA { get; set; }
public string ParamB { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
而AJAX-Call则是以下内容:
var myEntries = { entries: [{ ParamA: "A", ParamB: "B" }, { ParamA: "C", ParamB: "D" }] };
$.ajax({
type: 'POST',
url: url,
cache: false,
data: myEntries,
dataType: 'text' …Run Code Online (Sandbox Code Playgroud) 我的问题如下:假设你有三个不同的表(产品,票据和退货)
| ProductId | Name |
=====================
| 1 | Car |
| BillId | ProductId | Amount |
=================================
| 1 | 1 | 100$ |
| 2 | 1 | 200$ |
| ReturnId | ProductId | Amount |
===================================
| 1 | 1 | 50$ |
Run Code Online (Sandbox Code Playgroud)
SINGLE Query如何获得以下输出:
| Product-ID | Name | Type | Amount |
=====================================
| 1 | Car | Bill | 100$ |
| 1 | Car | Bill | 200$ |
| …Run Code Online (Sandbox Code Playgroud) 我只是用Google搜索了大约2个小时,但没有找到任何东西.
鉴于以下情况:
public class Person
{
[Required]
public string Name { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
XAML:
<TextBox Text="{Binding Name, Mode=TwoWay}" />
Run Code Online (Sandbox Code Playgroud)
您将如何在MVC3中自动获取UI上的验证反馈?
(哦,如果我能够使用像[必需]那样的集成数据注释,我现在真的不在乎)
任何帮助深表感谢!
ajax ×1
jquery ×1
left-join ×1
sql ×1
t-sql ×1
validation ×1
windows-8 ×1
winrt-xaml ×1
xaml ×1