0

我有这个曾经可以工作的aspx代码(在.net 2.0上):

<Templates>
   <EditForm>
      <div>
         <dxe:ASPxMemo runat="server" ID="Memo1" Text='<%#Bind("field1")%>' Width="100%" Height="60px" ReadOnly="true" BackColor="#E6E6E6"></dxe:ASPxMemo>
...

现在我试图在相同的上下文中重新使用它,但使用.net 3.5,但我得到了一个错误。我会尝试翻译它:

无法编辑控件,因为控件包含代码块(如 <% ... %>)。

所以我试图通过 vb.net 代码这样做:

Memo1.Text = #Bind("field1")

但由于保护级别,看起来无法访问 Memo1

我怎样才能让它再次工作?

编辑:在这里找到一个教程http://demos.devexpress.com/aspxgridviewdemos/GridEditing/EditFormTemplate.aspx

但本教程也使用括号 insde 文本!

4

1 回答 1

0

Solved! Looks like that ASPxGridView doesn't like <% ... %> code inside the page header.

Some days ago i added in my master page's <head> a simple <% Response.Write() %> and the entire ASPxGridView failed because of that.

Moving that code outside the header resulted in a working ASPxGridView, that was not a problem of .NET framework version!

于 2013-05-10T15:05:47.693 回答