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

ItemTemplate and code behind data passing

5
I am trying to do a simple calculation and then databind it in my repeater. The ItemTemplate code sends two integers to a code behind function as follows

<td style="width: 75px">
<asp:Label Text='<%# Get_Percent(Eval("Total"), Eval("itemCount")) %>' Runat="Server" />
</td>


The C# function is as follows:

protected int Get_Percent(int baseline, int available, out int percent)
{
if (available > 0)
{
percent = available / baseline * 100;
}
else percent = 0;
return percent;

}

My build error is: No overload for method ‘Get_Percent’ takes ‘2’ arguments.
I know this should be simple, but I’m not sure where my mistake is. Any help would be greatly appreciated.
Oct 18 '07 #1
2 1714
Shashi Sadasivan
1,435 Expert 1GB
Get_Percent takes 3 arguments, and you are passing only 2 !!! (ding ding)
Oct 18 '07 #2
redeye
5
OK, after some other twikes like convert and using getting ride of the ints it worked.
Thanks
Oct 18 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Nevyn Twyll | last post by:
I have a web form, with c# code-behind. I have a listbox on the form, bound to a dataset. I want to have 2 buttons/hyperlinks/etc. beside the listbox. When they are clicked, I want to launch a...
3
by: Stimp | last post by:
I have a datalist that outputs a link to a picture in each ItemTemplate: e.g. <asp:DataList id="DataList1" ...etc> <ItemTemplate> <a href='Pic.aspx?pic=somenumber'>picture</a> </ItemTemplate>...
6
by: SteveB | last post by:
I have an SQl db with 5 address fields. Address field 1 and 2 always contain data. Fields 3 4 and 5 are sometimes null. I have a Repeater set up to display the addresses. How do show a conditional...
1
by: Jesper Pedersen | last post by:
Hi ! How do I access the following spillerID and Session from another *aspx page in my application? <ItemTemplate> <a href="player_details.aspx?spillerID=<%#...
6
by: Paul | last post by:
I am trying to use a DataList and the ItemTemplate. I am binding the Datalist to a SQL query that gives me a list of Items with a Parent Category. I want to loop through all the items, but...
1
by: VB Programmer | last post by:
With HTML, how do I get the value of a textbox in an ItemTemplate column within a datagrid? Simple shopping cart. For each row: 1 column is a textbox where they can enter the quantity. 1...
1
by: Mike | last post by:
Hello all, Is there a way to change the ItemTemplate based on the data that is being shown? For instance, I have a dataset, contains two fields (NAME, STATE). I want to show all the records...
2
by: mj.redfox.mj | last post by:
Hi, I wonder if someone could possibly help with this? I have the following code, which is a nested repeater in turn nesting a datalist. This all works fine, together with my page-behind vb code...
7
by: JJ | last post by:
I'm sure this is quite simple, but clearly not for me today: How do you set the CSS Style of a tag in a repeater Item Template? e.g. I have this repeater: <asp:Repeater runat="server"...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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.