PRB: Declarative Data Binding Does Not Work in the Mobile Textbox Control (309819)



The information in this article applies to:

  • Microsoft Mobile Internet Toolkit (MMIT)

This article was previously published under Q309819

SYMPTOMS

When you use declarative or inline data binding with the mobile TextBox control, the binding does not evaluate at runtime when you use the following code:
<mobile:TextBox id="TextBox1" runat="server">
     <%# Data Binding Syntax %>
</mobile:TextBox>
				

CAUSE

This behavior occurs because the mobile TextBox control omits any data binding code or text that is located after a carriage return and discards all leading and training spaces.

RESOLUTION

Use one of the following two methods to work around this behavior:
  • Remove any carriage returns after you start the mobile Textbox tag. You can use the following code in a mobile Web Form:
    <mobile:TextBox id="TextBox1" runat="server"><%# Data Binding Syntax %></mobile:TextBox>
    					
    -or-

  • Place the data binding syntax in the text property. You can use the following code in a mobile Web Form:
    <mobile:TextBox id="TextBox1" runat="server" Text='<%# Data Binding Syntax %>'></mobile:TextBox>
    					

STATUS

This behavior is by design.

Modification Type:MajorLast Reviewed:6/14/2002
Keywords:kbDataBinding kbDSupport kbprb kbServerControls KB309819