我已经安装了Ext.2.5.2,但一直给我这个错误“类型'Ext.Net.JsonReader'没有名为'Fields'的公共属性。“ [英] I have installed Ext.2.5.2 but keeps giving me this error" Type 'Ext.Net.JsonReader' does not have a public property named 'Fields'."
问题描述
这是我得到的错误:
This is the error I get:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Type 'Ext.Net.JsonReader' does not have a public property named 'Fields'.
Source Error:
Line 84: <Reader>
Line 85: <ext:JsonReader IDProperty="ID">
Line 86: <Fields>
Line 87: <ext:RecordField Name="ID" />
Line 88: <ext:RecordField Name="Name" />
Source File: /WebForm1.aspx Line: 86
这是我的代码:
< script runat =server>
protected void Page_Load(object sender,EventArgs e)
{
this.Store1.DataSource = this.Jobs;
this.Store1.DataBind();
}
private List< job>工作
{
get
{
List< job> jobs = new List< job>();
for(int i = 1; i< = 50; i ++)
{
jobs.Add(新工作(
i,
任务+ i.ToString(),
DateTime.Today.AddDays(i),
DateTime.Today.AddDays(i + i),
(i%3 == 0)));
}
返回工作;
}
}
公共课工作
{
公共工作(int id,字符串名称,DateTime开始,DateTime结束,bool完成)
{
this.ID = id;
this.Name = name;
this.Start = start;
this.End = end;
this.Completed = completed;
}
public int ID {get;组; }
public string Name {get;组; }
public DateTime Start {get;组; }
public DateTime End {get;组; }
public bool已完成{get;组; }
}
< / script>
< / head>
< body>
< form id =form1runat =server>
This is my Code:
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
this.Store1.DataSource = this.Jobs;
this.Store1.DataBind();
}
private List<job> Jobs
{
get
{
List<job> jobs = new List<job>();
for (int i = 1; i <= 50; i++)
{
jobs.Add(new Job(
i,
"Task" + i.ToString(),
DateTime.Today.AddDays(i),
DateTime.Today.AddDays(i + i),
(i%3 == 0)));
}
return jobs;
}
}
public class Job
{
public Job(int id, string name, DateTime start, DateTime end, bool completed)
{
this.ID = id;
this.Name = name;
this.Start = start;
this.End = end;
this.Completed = completed;
}
public int ID { get; set; }
public string Name { get; set; }
public DateTime Start { get; set; }
public DateTime End { get; set; }
public bool Completed { get; set; }
}
</script>
</head>
<body>
<form id="form1" runat="server">
< ext:ResourceManager runat =server/>
< ext:Window
ID =Window1
runat =server
Collapsible =true
Maximizable =true
Icon =Lorry>
Title =工作清单
宽度=600
高度=300
X =50
Y =50
CenterOnLoad =false
布局=适合>
< ; item>
< ext:GridPanel
ID =GridPanel1
runat =server
StripeRows =true
Header =false
Border =false
AutoExpandColumn =Name>
< store>
< ext:Store ID =Store1runat =server>
< reader>
< ext:jsonreader idproperty =ID xmlns:ext =#unknown>
< fields>
< ext:recordfield name =ID>
< ext:recordfield name =Name>
< ext:recordfield name =Starttype =Date>
< ext:recordfield name =Endtype =Date>
< ext:recordfield name =Completedtype =Boolean>
< loadmask showmask =false>
< SelectionModel>
< ext:RowSelectionModel
ID =SelectedRowModel1
runat =server
SingleSelect =true
/>
< / SelectionModel>
< ColumnModel runat =server>
< columns> < ext:列xmlns:ext =#unknown>
标题=ID
宽度=40
可排序=true
DataIndex =ID
/>
< ext:column>
ColumnID =姓名
标题=工作名称
可排序=真实
DataIndex =姓名
/>
< ext:datecolumn>
ColumnID =开始
标题=开始
宽度=120
可排序=真实
DataIndex =开始
格式=yyyy-MM-dd
/>
< ext:datecolumn>
ColumnID =结束
标题=结束
宽度=120
可排序=真
DataIndex =结束
格式=yyyy-MM-dd
/>
<分机:栏目>
ColumnID =已完成
页眉=已完成
宽度=80
Sortable =true
DataIndex =已完成>
< renderer handler =return(value)? '是':'不';>
< plugins>
< ext :GridFilters runat =serverLocal =true>
< filters>
< ext:numericfilter dataindex =IDxmlns:ext =#未知>
< ext:stringfilter dataindex =名称xmlns:ext =#unknown>
< ext:datefilter dataindex =Start xmlns:ext =#unknown>
< DatePickerOptions runat =serverTodayText =Now/>
< ext:datefilter dataindex =Endxmlns:ext =#unknown>
< DatePickerOptions runat =serverTodayText =Now/>
< ext:booleanfilter dataindex =已完成xmlns:ext =#unknown>
< bottombar>
< ext:PagingToolbar
runat =server
PageSize = 10
DisplayInfo =true
DisplayMsg =显示工作{0} - {1}的{1}
/ >
推荐答案
这篇关于我已经安装了Ext.2.5.2,但一直给我这个错误“类型'Ext.Net.JsonReader'没有名为'Fields'的公共属性。“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!