whats wrong with this code and i am getting this error:
Compiler Error Message: CS1502: The best overloaded method match for 'RenderName(string, string)' has some invalid arguments
<ItemTemplate>
<asp:Label ID="lblName" Text='<%# RenderName(Eval("Name"), Eval("Value")) %>' runat="server" />
</ItemTemplate>
public string RenderName(string name, string value)
{
//do stuffs..
}
If the return type of Eval() is an object (and I suspect it is), that would explain the error you’re seeing. Maybe change your function to:
Then within the function, check the passed params for null, and either re-cast them to strings, or simply call ToString() on them.
Note: I’m not at a place where I can verify this in my own development environment, so apologies if this approach has a few hiccups.