|
-
Apr 26th, 2006, 02:33 PM
#1
[RESOLVED] [2005] Bind Checked Value of Checkbox to DataSource
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:
<td align="right"><asp:Label ID="Label2" runat="server" Text=" [Is Approved]" Visible='<%#Eval("IsApproved")%>'/></td>
and
VB Code:
<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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|