1 <div id="Childpage">
2
3 <fieldset>
4 <legend></legend>
5 <div>
6 @Html.Encode("货号: ")
7 </div>
8 @Html.TextBox("COP_G_NO")
9 <div >
10 @Html.Encode("账册号: ")
11 </div>
12 @Html.TextBox("EMS_NO")
13 <br/>
14 @Ajax.ActionLink("查询", "OderHeadIndex", "WorkOrder", new AjaxOptions { UpdateTargetId = "DivGrid" })
15
16
17 @* <input id="btn" type="Submit" value="search" />*@
18 </fieldset>
19
20 @* @{Html.RenderPartial("_QueryOderHead");}
21 Html.Partial("~/WorkOrder/QueryOderHead.cshtml")*@
22 @using (Ajax.BeginForm("OderHeadIndex", "WorkOrder", new AjaxOptions { UpdateTargetId = "DivGrid" }))
23 {
24
25 var grid = new WebGrid(source: Model,
26 fieldNamePrefix: "grid_",
27 defaultSort: "ROWID",
28 canPage: true,
29 canSort: true,
30 ajaxUpdateContainerId: "DivGrid",
31 pageFieldName: "paging",
32 sortFieldName: "sortField",
33 rowsPerPage: 10);
34 var i = grid.RowsPerPage * grid.PageIndex;
35
36 <div id="DivGrid">
37 <div style="margin-left:75px;" ><input id="toggleAllCheckBox" type="checkbox"/></div>
38
39
40 @grid.GetHtml(
41 columns: grid.Columns(
42 grid.Column(format: @<text><input type="checkbox" class="check-box" value="@item.ROWID"/></text>, header: "全选"),
43
44 grid.Column(format: @<text> @(++i) </text>, header: "行号"),
45 grid.Column("ROWID", "ROWID"),
46 grid.Column("WO_NO", "WO_NO"),
47 grid.Column("WO_DATE", "WO_DATE"),
48 grid.Column("COP_G_NO", "货号"),
49 grid.Column("QTY", "数量"),
50 grid.Column("UNIT", "单位"),
51 grid.Column("EMS_NO", "账册号"),
52 grid.Column("CREATE_DATE", "创建日期"),
53 grid.Column("SEQ_NO", "SEQ_NO")
54 )
55 )
56 <h2>
57 Page Count:
58 @Html.Encode(grid.PageCount)
59 <br/>
60 Total Record:
61 @Html.Encode(grid.TotalRowCount)
62 </h2>
63 </div>
64
65
66
67 }
68 </div>
点击查询会出现下面的情况
这是什么问题引起的请高手帮忙解决,谢谢!
有个参数是设置是替换掉<div />的内容还是直接覆盖掉的.
System.Web.Mvc.Ajax.AjaxOptions类的InsertionMode属性(枚举来的)
Replace 替换元素
InsertBefore 在元素前面插入
InsertAfter 在元素后面插入
不知道是不是这个原因,你可以试试?
@dotNetDR_: 试过了三种模式都试了还是不行,不过换了一种方式进行编写已经解决了
@ramble:
... -1了...5555
哥们儿,你怎么解决的?我也遇到了同样的问题