Forum
smartDBforms.NET for ASP.NET 2
 
 
Knowledge Base Forum
To post messages on the forum, you need to login first.
SearchForum Home
  Product Forums  smartDBforms.NET  Bind problem: A...
 Bind problem: A call to Bind was not well formatted
 
 9/30/2007 7:03:20 AM
Olivie
1 posts


Bind problem: A call to Bind was not well formatted
Good day,

In smart form I have one special database field which I need to edit with two-way databinding with Bind command. I have created TextBox and set binding but when run the page this error displays:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: A call to Bind was not well formatted.  Please refer to documentation for the correct parameters to Bind.

Source Error:

Line 91: <h4>Codes</h4>
Line 92: <div class=specialGroup>
Line 93: <asp:TextBox ID="RoomCodeTextBox" runat="server" Text=<%# Bind("Room Code") %> ReadOnly="<%# Container.IsReadOnlyMode %>"></asp:TextBox>
Line 94: <br />
Line 95: </div>

I changed asp code in several ways but the problem didnt disappear
Please help with this issue!
 10/1/2007 12:21:05 PM
Adillis Support
27 posts
adillis.com


Re: Bind problem: A call to Bind was not well formatted
 Modified By host1  on 10/1/2007 12:52:25 PM)
Hi Olivie,

The problem is caused by the ASP.NET Bind operator. It does not work when the field has spaces or other special characters. Your field name contains space and this is causing the error.

You can resolve this problem in two ways
  • Instead of TextBox you can use SmartDBControl. If you need some additional user interface template you can create one. For more information see the following KB article - HOWTO: Modify default template set.
  • In your case replace <%# Bind("Room Code") %> with <%# Eval("Room Code") %>. In addition you will need to write a line of code in order to extract the value back into the database.

Create an event handler for the SmartDBView.ValuesExtracted event and implement it in the following way.
Protected Sub SmartDBView1_ValuesExtracted(ByVal sender As Adillis.SmartDBForms.SmartDBView, ByVal e As Adillis.SmartDBForms.SmartDBViewExtractedArgs)
e.Values("Room Code") = CType(sender.FindControl("RoomCodeTextBox"), TextBox).Text
End Sub
This code will transfer the value from the text box to the database data.


If you have any other questions, we will be more than happy to help you.
Best wishes,
Adillis Support
Adillis - IT solutions http://adillis.com


  Product Forums  smartDBforms.NET  Bind problem: A...
Copyright 2006-2008 Adillis Terms Of Use Feedback Contact Us