473,386 Members | 1,752 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Binding an Array from a Web Service

I'm new to ASP.NET, but have been asked to create an ASP.NET app that
retrieves data from a third-party web service.

I've managed to connect and retrieve the data from the web service, but
am having trouble getting the returned data displayed on the resulting
web page. Well, at least how I want it displayed.

Currently, in the code-behind I have the a response object that has a
method 'actions' which is an array of type 'Action'.

In the main file, I am currently using a DataList like:

<asp:DataList id="actions" runat="server" >
<ItemTemplate>
<%# Eval("actionType") %>
<%# Eval("summary") %>
</ItemTemplate>
</asp:DataList>

And I bind to this in the code-behind with:

actions.DataSource = response.actions;
actions.DataBind();

This results in each action displayed in a table cell. I would prefer
each row to be comprised of two cells, like:
<tr>
<td>actionType</td>
<td>summary</td>
</tr>

How should I go about this? Is DataList even what I need to be using?

Thanks,
Trey

Nov 7 '06 #1
2 1279
Your item template may have HTML markup. So you can put a table tag in there
and create a mini table for every row.

You can also look into the Repeater control. It is like a DataList, however,
unlike the DataList it does not build a bunch of HTML around each row and
the entire list for you. It literally generates the HTML in your header,
your footer, and your item template without any of its own markup. This
gives you very fine control over what ends up being generated if that is
what you need.
"Trey Bean" <tr******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I'm new to ASP.NET, but have been asked to create an ASP.NET app that
retrieves data from a third-party web service.

I've managed to connect and retrieve the data from the web service, but
am having trouble getting the returned data displayed on the resulting
web page. Well, at least how I want it displayed.

Currently, in the code-behind I have the a response object that has a
method 'actions' which is an array of type 'Action'.

In the main file, I am currently using a DataList like:

<asp:DataList id="actions" runat="server" >
<ItemTemplate>
<%# Eval("actionType") %>
<%# Eval("summary") %>
</ItemTemplate>
</asp:DataList>

And I bind to this in the code-behind with:

actions.DataSource = response.actions;
actions.DataBind();

This results in each action displayed in a table cell. I would prefer
each row to be comprised of two cells, like:
<tr>
<td>actionType</td>
<td>summary</td>
</tr>

How should I go about this? Is DataList even what I need to be using?

Thanks,
Trey

Nov 7 '06 #2
Awesome. This is exactly what I needed. Thanks!

On Nov 7, 1:20 pm, "Marina Levit [MVP]" <some...@nospam.comwrote:
Your item template may have HTML markup. So you can put a table tag in there
and create a mini table for every row.

You can also look into the Repeater control. It is like a DataList, however,
unlike the DataList it does not build a bunch of HTML around each row and
the entire list for you. It literally generates the HTML in your header,
your footer, and your item template without any of its own markup. This
gives you very fine control over what ends up being generated if that is
what you need.

"Trey Bean" <treyb...@gmail.comwrote in messagenews:11**********************@b28g2000cwb.g ooglegroups.com...
I'm new to ASP.NET, but have been asked to create an ASP.NET app that
retrieves data from a third-party web service.
I've managed to connect and retrieve the data from the web service, but
am having trouble getting the returned data displayed on the resulting
web page. Well, at least how I want it displayed.
Currently, in the code-behind I have the a response object that has a
method 'actions' which is an array of type 'Action'.
In the main file, I am currently using a DataList like:
<asp:DataList id="actions" runat="server" >
<ItemTemplate>
<%# Eval("actionType") %>
<%# Eval("summary") %>
</ItemTemplate>
</asp:DataList>
And I bind to this in the code-behind with:
actions.DataSource = response.actions;
actions.DataBind();
This results in each action displayed in a table cell. I would prefer
each row to be comprised of two cells, like:
<tr>
<td>actionType</td>
<td>summary</td>
</tr>
How should I go about this? Is DataList even what I need to be using?
Thanks,
Trey
Nov 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: JL_327 | last post by:
No one on any of the other boards seem to know In VB.Net this late binding works fine Dim Version As Integer Dim Revision As Integer Dim Wnum As Integer Dim o As System.Array =...
0
by: maxim mat | last post by:
Hi I need to build client for web service. But when I'm using Visual Studio .NET to add Web Reference, I get error: "Custom tool error: Unable to import WebService/Schema. Unable to import...
2
by: mark | last post by:
I understand that writing programs with option strict on is the best way to obtain stable applications. I have also found the applications to run much faster. Option strict on disallows late...
30
by: lgbjr | last post by:
hi All, I've decided to use Options Strict ON in one of my apps and now I'm trying to fix a late binding issue. I have 5 integer arrays: dim IA1(500), IA2(500), IA3(500), IA4(500), IA5(500) as...
1
by: google | last post by:
I have created a simple HelloWorld application in WSE2.0 SP3. When I browse to the endpoint url over http (e.g. http://localhost/TestService.ashx) the WSDL is fine and I can create a client...
0
by: Steven Bolard | last post by:
Hello, I am trying to port my .net 1.1 application to 2.0. I am using vs2005. I am trying to get my webservices to run and although i can compile them and and get wsdl and service descriptions...
9
by: Miro | last post by:
VB 2003 and Im still new to vb, so i hope i can explain this as best I can. I have a variable defined as such: ( simple example ) Dim AVariableOfSorts(,) As Object = _ { _ {"Last", "String",...
0
by: SMcLellan | last post by:
Say, is anyone else using WCF under Vista and seeing delays on the order of 7-8 seconds when a WCF client, using the net.TCP binding, establishes a connection with a non-local service? I have a...
18
by: mdh | last post by:
>From p112 ( K&R). Given an array declared as static char arr= { { 0,1,........},{0,1,.....}}; let arr be passed as an argument to f. f( int (*arr) ) {....} It is noted that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.