- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在本地iis上发布项目时没有任何警告,并且它可以正常运行(localhost/[myprojectName])。所以,我用可爱的ftp将它们上传到服务器。但是在服务器上,我的所有文件都出现此错误,如[tableName]。[filedName]:
A field or property with the name 'ConfirmStatuse.Name' was not found on the selected data source
<asp:GridView ID="ordergv" runat="server" DataKeyNames="Id" AutoGenerateColumns="False" DataSourceID="SummaryOfOrderSrc" AllowSorting="True">
<Columns>
<asp:CommandField SelectText="select" ShowSelectButton="True" ButtonType="Button"/>
<asp:BoundField DataField="OrderId" />
<asp:BoundField DataField="ConfirmStatuse.Name" />
<asp:BoundField DataField="OrderStatuse.Name"/>
<asp:BoundField DataField="PaymentStatuse.Name"/>
<asp:BoundField DataField="ShipmentStatuse.Name" />
<asp:TemplateField >
<ItemTemplate>
<asp:Label ID="CreatedDateLabel" runat="server" Text='<%# GetPersianDate( Eval("CreatedDate")) %>' /></ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:LinqDataSource ID="SummaryOfOrderSrc" runat="server" ContextTypeName="Ahooratech.DAL.DataClasses1DataContext" EntityTypeName="" OrderBy="CreatedDate desc" TableName="Orders">
</asp:LinqDataSource>
最佳答案
这与此处描述的问题相同-Binding to Navigation Property causes " A field or property with the name 'X.X' was not found on the selected data source" in IIS 6 ONLY
BoundField控件元素似乎是一个问题。就像上面链接的an answer provided by user Anant中建议的那样,您可以将BoundField转换为TemplateField,并且它可以工作(在示例中使用“OrderStatuse.Name”)。该解决方案对我有用。
尽管这实际上并不能解释的原因,但IISt不能通过 IIS6来支持BoundField。
头脑陷入僵局。
关于asp.net - 错误: “A field or property with the name was not found on the selected data source” get only on server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17120505/
我是一名优秀的程序员,十分优秀!