473,385 Members | 1,267 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,385 software developers and data experts.

Extracting values from ArrayList

AryUnderNav = New ArrayList()
AryUnderNav.Add("Under $50")
AryUnderNav.Add("$50 - $100")
AryUnderNav.Add("$100 - $200")
AryUnderNav.Add("$200 +")

UnderNav.DataSource = AryUnderNav
UnderNav.DataBind()

....
I want to list these items horizontally on the page. What is the syntax to get the value of each Array item?

Here is what I've tried to do.

<asp:DataList id="UnderNav" RepeatDirection="Horizontal" runat=server>
<ItemTemplate>

{{{{{{{{{{{ I want a URL here with the Index number in the href and the string value as the link text. }}}}}}}}}}

</ItemTemplate>
</asp:DataList>



Thanks

Sonny Sablan
Nov 19 '05 #1
3 1718
Just do
<%# Container.DataItem %>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Sonny Sablan" <so***@sablan.org> wrote in message news:eM**************@TK2MSFTNGP09.phx.gbl...
AryUnderNav = New ArrayList()
AryUnderNav.Add("Under $50")
AryUnderNav.Add("$50 - $100")
AryUnderNav.Add("$100 - $200")
AryUnderNav.Add("$200 +")

UnderNav.DataSource = AryUnderNav
UnderNav.DataBind()

...
I want to list these items horizontally on the page. What is the syntax to get the value of each Array item?

Here is what I've tried to do.

<asp:DataList id="UnderNav" RepeatDirection="Horizontal" runat=server>
<ItemTemplate>

{{{{{{{{{{{ I want a URL here with the Index number in the href and the string value as the link text. }}}}}}}}}}

</ItemTemplate>
</asp:DataList>



Thanks

Sonny Sablan
Nov 19 '05 #2

Thanks...

Also,

How do I extract the index of the data?
And how can I use a datalist that does not write a table?

I want to list the items without cells.

Sonny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #3
Sonny:
Try
<%# Container.ItemIndex %> but remember that it's 0 based.

If you want more control over how your databound controls are created, I
suggest you look at the Repeater control which gives you great flexibility.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Sonny Sablan" <so***@sablan.org> wrote in message
news:ec**************@TK2MSFTNGP11.phx.gbl...

Thanks...

Also,

How do I extract the index of the data?
And how can I use a datalist that does not write a table?

I want to list the items without cells.

Sonny
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 19 '05 #4

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

Similar topics

0
by: Mico | last post by:
I would be very grateful for any help with the following: I currently have the code below. This opens a MS Word document, and uses C#'s internal regular expressions library to find if there is a...
0
by: Bubbles | last post by:
Hello. New to ASP.NET and struggling on this one. I have a text file with a bunch of text in it. Throughout the file words followed by a ":" will appear. I need to pull every such string out...
0
by: Dave | last post by:
Hi all, I have a listbox that is complex bound by an arraylist. The problem is that when I delete an object from the arraylist, the listbox does not reflect those changes. I tried refreshing...
4
by: Jon Paal | last post by:
I am using a custom server control in my webpage which renders some html. while it creates the html, it develops an arraylist of values. Is there a way to capture the arraylist from the control...
6
by: Pavel Maly | last post by:
Hi, how do I access values in an ArrayList which is a part of another ArrayList? I know I can define a class and then it is quite simple, but this is just an auxiliary application to compute some...
8
by: Pim75 | last post by:
Hello, I'm defining a string array like: Dim strArray() As String = {"1", "2"} Can I add some values to this string array later in the code? It's not clear to me how to do this. I hope...
9
by: norulzs | last post by:
Hi, In a attempt to create a dynamic multi diminsion array i am using a ArrayList object as i do not know how many dimension i will need during runtime. My code is ArrayList mySubArray = new...
9
by: ajos | last post by:
Hello friends, After thinking about this for sometime, i decided to post this in the java forum. Well my problem here in detail is, i have 3 jsp pages where in a.jsp(for example) i have a combo...
1
by: cowboyrocks2009 | last post by:
Hi. I want to return values from multiple Arraylist. How can I do that ? later I want to use these values in another class. Can somebody help class myClass{ public ArrayList<Rectangle>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.