Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Quote from <a href="http://weblogs.asp.net/leftslipper/archive/2007/06/29/how-asp-net-databinding-deals-with-eval-and-bind-statements.aspx" rel="noreferrer">http://weblogs.asp.net/leftslipper/archive/2007/06/29/how-asp-net-databinding-deals-with-eval-and-bind-statements.aspx</a></p> <blockquote> <p>There isn’t a Bind method in ASP.NET. When ASP.NET parses your file and sees you're using</p> it generates some special code for it. When you use it's not a real function call. If ASP.NET parses the code and detects a Bind() statement, it splits the statement into two parts. The first part is the one-way databinding portion, which ends up being just a regular Eval() call. The second part is the reverse portion, which is typically some code along the lines of "string name = TextBox1.Text" that grabs the value back out from where it was bound. However, because ASP.NET has to parse Bind() statements, two-way databinding doesn’t support anything other than Bind(). For example, the following syntax is invalid because it tries to invoke arbitrary code and use Bind() at the same time: <p>The only formats supported in two-way databinding are Bind("field") and Bind("field", "format string {0}").</p> </blockquote> <p>You could use Eval instead of Bind in your EditItemTemplate. You also need to cast to string:</p> <pre><code>&lt;asp:Label ID="LabelDescription" runat="server" Text='&lt;%# System.Web.HttpUtility.HtmlEncode((string)Eval("Description")) %&gt;' /&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload