Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - Extracting values from ArrayList

 
Thread Tools Search this Thread
Old 01-28-2005, 11:14 PM   #1
Default 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.

<aspataList 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>
</aspataList>



Thanks

Sonny Sablan


Sonny Sablan
  Reply With Quote
Old 01-29-2005, 05:11 AM   #2
Karl Seguin
 
Posts: n/a
Default Re: Extracting values from ArrayList
Just do
<%# Container.DataItem %>

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Sonny Sablan" <> wrote in message news:...
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.

<aspataList 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>
</aspataList>



Thanks

Sonny Sablan


Karl Seguin
  Reply With Quote
Old 01-29-2005, 10:07 AM   #3
Sonny Sablan
 
Posts: n/a
Default Re: Extracting values from ArrayList

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!


Sonny Sablan
  Reply With Quote
Old 01-29-2005, 01:31 PM   #4
Karl Seguin
 
Posts: n/a
Default Re: Extracting values from ArrayList
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" <> wrote in message
news:ec$...
>
> 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!





Karl Seguin
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cisco QOS MIB values required manjunatht Hardware 1 06-13-2008 02:34 PM
Values set by javascript are not reflected in serverside(.Net) rchimakurty Software 2 11-28-2007 10:07 AM
Checkbox values problem in gridview thanigaimani.thirumalai Software 0 11-09-2007 05:12 AM
Cisco QOS MIB values required manjunatht Software 0 09-11-2007 05:40 PM
How to make the form View save it's field values in Visual Stdio .NET asammoud Software 0 07-17-2007 10:57 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46