?
Solved

Formatting an ASP Repeater Container Data Item

Posted on 2004-04-26
6
Medium Priority
?
410 Views
Last Modified: 2012-06-21
I have a repeater that is loaded with a sql data reader in my start page. One of the fields I need is the price of the product and when I use the repeater, I can only access the data via <%#Container.DataItem("dblBasePrice") %>

 Is there a tag in ASP that I can put between the container.dataitem to format the number as currency?

Thanks,
LR
0
Comment
Question by:Luis_Romero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Accepted Solution

by:
chaniewskim earned 500 total points
ID: 10921557
You can use syntax

<%# DataBinder.Eval(Container.DataItem, "dblBasePrice", "{0:C}") %>
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10921586
You could do either of these:

<%# DataBinder.Eval(Container.DataItem, "dblBasePrice", "{0:c}") %>

or this (faster):

<%# String.Format("{0:c}", ((DataRowView) Container.DataItem)["dblBasePrice"]) %>

Good Luck,
Steve
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10921601
Right behind you again chaniewskim.

Can you wait 5 minutes before you post the next time? :)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 5

Expert Comment

by:chaniewskim
ID: 10921654
Steve,
I'll try ;)
0
 

Author Comment

by:Luis_Romero
ID: 10922267
Thank you both for your help.

Where can I find more information on the DataBinder.Val method? as well as for the DataRow View method?

Thanks,
0
 
LVL 30

Expert Comment

by:SteveGTR
ID: 10922286
You can find help on these subject by going to:

http://www.msdn.microsoft.com/

And typing them in Search MSDN for.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month11 days, 8 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question