J
Jeremy
I'm trying to pass a value from a data repeater to a function in my
code behind page. The value is a decimal that i want to show either
in red or black if the number has a negative or positive value.
This works just fine if I try <%redBlack(Convert.ToDecimal(23.5);%>
But when I try to wrap it around the data control i keep getting this
error "CS1026: ) expected"
<%# redBlack(Convert.ToDecimal(DataBinder.Eval (Container.DataItem,
"BuyInAmount"));%>
public void redBlack(decimal intValue)
{
if (intValue < 0)
{
Response.Write("red"+intValue);
}
else
{
Response.Write("black"+intValue);
}
}
I can do something similar to this with a string? Would i have to
convert it to a string, then back to a decimal?
Thanks,
Jeremy
code behind page. The value is a decimal that i want to show either
in red or black if the number has a negative or positive value.
This works just fine if I try <%redBlack(Convert.ToDecimal(23.5);%>
But when I try to wrap it around the data control i keep getting this
error "CS1026: ) expected"
<%# redBlack(Convert.ToDecimal(DataBinder.Eval (Container.DataItem,
"BuyInAmount"));%>
public void redBlack(decimal intValue)
{
if (intValue < 0)
{
Response.Write("red"+intValue);
}
else
{
Response.Write("black"+intValue);
}
}
I can do something similar to this with a string? Would i have to
convert it to a string, then back to a decimal?
Thanks,
Jeremy