asp.net data binding USES eval to solve the problem of too many characters in the text of the time report characters

  • 2020-05-10 18:01:23
  • OfStack

When using datalist data binding:

 
<asp:TextBox ID="txtOutPlace" runat="server" Text ="<%#Eval(' Pull out the storage location of the unit ')%>" Width="130px"></asp:TextBox> 


Run "too many characters in character text" error, this time because Eval must be a string (" ") can not use single quotation marks, this is the surface reason, under the guidance of Eval binding mechanism, modify as follows:

 
<asp:TextBox ID="txtOutPlace" runat="server" Text ='<%#Eval(" Pull out the storage location of the unit ")%>' Width="130px"></asp:TextBox> 

Related articles: