Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to pass two eval bt here is problem

C#
<ItemTemplate>
                                   <asp:Label ID="lbstatus" Text='<%#checkstatus(Convert.ToInt32(Eval("IsCompanyAdmin"),Convert.ToInt32(Eval("IsDeleted")))) %>' runat="server" />
                               </ItemTemplate>


C#
Compiler Error Message: CS1502: The best overloaded method match for 'System.Convert.ToInt32(object, System.IFormatProvider)' has some invalid arguments


Thanks
Posted
Updated 29-Feb-12 1:36am
v2
Comments
shek124 29-Feb-12 7:38am    
How can you pass the two values in a label text property. What actually you looking for?

1 solution

put closing parenthesis after

HTML
#checkstatus(Convert.ToInt32(Eval("IsCompanyAdmin")
 
Share this answer
 
Comments
nawabprince 29-Feb-12 7:45am    
public string checkstatus(int status,int del)
{
if (status == 1 && del==0)
{
return "Admin";
}
else if (status == 0 && del==0)
{ return "User"; }
else {
return "Disabled";

}

}


<itemtemplate>
<asp:Label ID="lbstatus" Text='<%#checkstatus(Convert.ToInt32(Eval("IsCompanyAdmin"))),(Convert.ToInt32(Eval("IsDeleted"))) %>' runat="server" />


Compiler Error Message: CS1501: No overload for method 'checkstatus' takes 1 arguments
Solve this error..??
nawabprince 29-Feb-12 7:50am    
Thanks ProEnggSoft...I have done it...Thank you bro
ProEnggSoft 29-Feb-12 7:51am    
Replace

checkstatus(Convert.ToInt32(Eval("IsCompanyAdmin"))),(Convert.ToInt32(Eval("IsDeleted")))

with

checkstatus(Convert.ToInt32(Eval("IsCompanyAdmin")),Convert.ToInt32(Eval("IsDeleted")))

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900