R
Roger R. Smith
Anyway I am having a problem with Web Service and DataList in ASP.NET. so
the best way to explain it would be with the MSPetShop 3.0 Application.
I submitted an order using the Forms on http://localhost/MSPetShop. then I
created my own ASp.NET Project and I have a form on which I have a DataList,
b/c I want to display a bunch of items. BUt for this example I did the
following:
localhost.WebServices webservices = new localhost.WebServices();
localhost.OrderInfo order = webservices.GetOrder(1);
IList orderList = new ArrayList();
orderList.Add(order);
DataList1.DataSource = orderList;
DataList1.DataBind();
I added the Order to an ArrayList just to test, and then on the codebehind I
have the following:
<aspataList id="DataList1" style="Z-INDEX: 104; LEFT: 136px; POSITION:
absolute; TOP: 248px"
runat="server">
<HEADERTEMPLATE>
Roger
</HEADERTEMPLATE>
<ItemTemplate>
<TD><%# DataBinder.Eval(Container.DataItem, "OrderId") %></TD>
</ItemTemplate>
</aspataList>
but with this I am getting the following error:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval:
'WebServicePortal.localhost.OrderInfo' does not contain a property with the
name OrderId.
Source Error:
Line 45: </HEADERTEMPLATE>
Line 46: <ItemTemplate>
Line 47: <TD><%# DataBinder.Eval(Container.DataItem, "OrderId") %></TD>
Line 48: </ItemTemplate>
Line 49: </aspataList></P>
This is the same error I am getting on my application.
Any ideas?
the best way to explain it would be with the MSPetShop 3.0 Application.
I submitted an order using the Forms on http://localhost/MSPetShop. then I
created my own ASp.NET Project and I have a form on which I have a DataList,
b/c I want to display a bunch of items. BUt for this example I did the
following:
localhost.WebServices webservices = new localhost.WebServices();
localhost.OrderInfo order = webservices.GetOrder(1);
IList orderList = new ArrayList();
orderList.Add(order);
DataList1.DataSource = orderList;
DataList1.DataBind();
I added the Order to an ArrayList just to test, and then on the codebehind I
have the following:
<aspataList id="DataList1" style="Z-INDEX: 104; LEFT: 136px; POSITION:
absolute; TOP: 248px"
runat="server">
<HEADERTEMPLATE>
Roger
</HEADERTEMPLATE>
<ItemTemplate>
<TD><%# DataBinder.Eval(Container.DataItem, "OrderId") %></TD>
</ItemTemplate>
</aspataList>
but with this I am getting the following error:
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.HttpException: DataBinder.Eval:
'WebServicePortal.localhost.OrderInfo' does not contain a property with the
name OrderId.
Source Error:
Line 45: </HEADERTEMPLATE>
Line 46: <ItemTemplate>
Line 47: <TD><%# DataBinder.Eval(Container.DataItem, "OrderId") %></TD>
Line 48: </ItemTemplate>
Line 49: </aspataList></P>
This is the same error I am getting on my application.
Any ideas?