Hello,

I am hoping you can help cause this is starting to drive me crazy!

I am in the process of converting an ASP.Net Page, coded in VB, to C#. So far everything is going fine, except for the following two lines:

VB Code:
  1. <td align="right"><asp:Label ID="Label2" runat="server" Text=" [Is Approved]" Visible='<%#Eval("IsApproved")%>'/></td>

and

VB Code:
  1. <td colspan="2"><asp:CheckBox ID="IsApproved" Runat="server" checked='<%# Bind("IsApproved")%>' text="Is Approved?" /></td>

When run, there lines produce the following error:

"Specified cast is not valid"

I am returning a boolean in the DataSource, so I am not sure why it is returning an error!

Is there a way to cast to a Boolean in the Bind Statement, or can you think of another way to achieve the desired result, i.e. a tick in the checkkbox when a user is approved and also a visible textbox.

(P.S. I have already posted this question in the C# forum, but no-one seemed to be able to help. SOrry for Cross Posting, can a Mod delete my other post in the C# Forum, Cheers!)

Gary