The*_*edi 7 c# asp.net dotnetnuke webforms telerik
如果绑定到TextEditor时我使用以下语法:
Text='<%# Bind("DESCRIPTION") %>'
Run Code Online (Sandbox Code Playgroud)
提交表单时出现以下错误:
InnerMessage:Object reference not set to an instance of an object.
InnerStackTrace:
at DotNetNuke.UI.UserControls.TextEditor.get_Text()
at ASP.desktopmodules_mymodule_view_ascx.__ExtractValues__control16(Control __container)
at Telerik.Web.UI.GridTemplateColumn.FillValues(IDictionary newValues, GridEditableItem editableItem)
at Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues)
at Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem)
at Telerik.Web.UI.GridItemBuilder.CreateItems(GridGroupingContext group)
Run Code Online (Sandbox Code Playgroud)
似乎调用Text属性getter在数据绑定层中失败.
如果我将调用替换为与Eval绑定:
Text='<%# Eval("DESCRIPTION") %>'
Run Code Online (Sandbox Code Playgroud)
然后提交会忽略该字段,但我可以捕获数据源更新属性并手动从文本属性中获取文本并将其放在实体上.Text属性getter不会为我抛出错误.
为什么不自动绑定工作?注意,此TextEditor位于DnnGrid的EditItemTemplate中.我不确定这是否相关 - 我没有尝试绑定到网格外的一个.