I would like to Bind() a TextBox in an EditItemTemplate but I need to pass the original value of the textbox to a function before it’s displayed. My goal is to format the value before displaying it. It’s a complex formatting rule so I can’t use any of the built-in formatters. It’s easy to do when working with Eval() but with Bind() it’s another story. I know it can be done using events in the code-behind but I was trying to do it all from the aspx page.
Example:
<EditItemTemplate>
<asp:TextBox ID="NameTextBox" Text=<%# Bind("Name") %> MaxLength="255" runat="server" />
</EditItemTemplate>
Thanks…
Something like this should be pretty close to what you’re looking for:
And in the code-behind: