Mar 29, 2005 10:12 AM|gotty101|LINK
I recently built a standard web forms app, within I had datagrids with template columns. With in the template columns there where labels. A datatable was bound to the datagrid and was bound. The certain fields
where then bound to the corresponding labels in the template column using the following code in the html
<%# DataBinder.Eval(Container.DataItem,"PurchaseCount") %>
Today I came to write my first mobile web app. On the form I added a objectList control, I then right clicked and selected templating options and added the “default” group. As the markup schema “Mobile HTML 3.2
Template” was auto selected. Again a datatable was bound to the datagrid and was bound.
I then proceeded to build my template column using mobile labels, and in the html for the label
When I tried to run the page I got the following error
“Compiler Error Message:
BC30456: 'DataItem' is not a member of 'System.Web.UI.MobileControls.TemplateContainer'.”
And the error pointed to the DataBinder.eval line in the html.
Does anyone know how to do this correctly? Or know of a weblink where I may find out how to acceve this. Ive
tried the examples given by Microsoft at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mwsdk/html/mwcondatabindingviewingdatausingobjectlistcontrol.asp
to the bottom of the page and I could not get any to work.
Im sure what im trying to do is posiable as once the server has built the page and sent it, all the client would
be getting is lables within a table