<%#((bool)Eval("isActive"))?
"<tr align='center'><td><small>(You are here)</small></td></tr>" : ""%>
This line is throwing error. bool is not taking here
It's strange that HTML code which working on VS 2008, not working on VS 2010. Maybe there is various Framework version on VS 2010. I don't know, check it.
It's strange that HTML code which working on VS 2008, not working on VS 2010. Maybe there is various Framework version on VS 2010. I don't know, check it.
Hi,
I think the issue with C# and Vb.Net. It is working in C# but not in vb.net
ramll
Participant
1127 Points
1299 Posts
Repeater HTML not working.
Jan 07, 2013 09:32 PM|LINK
Hello,
The following HTML is working. I developed the application in VS 2008. Now, I am developing 2010, the following HTML is not working.
What would be the difference.
<asp:Repeater ID="RepWfChart" runat="server"> <ItemTemplate> <div style="float: left; width: 169px; height: 78px; margin-bottom:10px"> <table style='background-image: url(Image/<%#((bool)Eval("isActive"))? "WfBlockActive.gif":"WfBlockInactive.gif"%>); width: 169px; height: 78px'> <tr align="center"> <td valign="middle"> <asp:Label runat="server" Text='<%#Eval("Title")%>' ID="lblTitle" ToolTip='<%#Eval("Description")%>' /> </td> </tr> <%#((bool)Eval("isActive"))? "<tr align='center'><td><small>(You are here)</small></td></tr>" : ""%> </table> </div> </ItemTemplate> <SeparatorTemplate> <div style="float: left; width: 54px; height: 78px;margin-bottom:10px"> <asp:Image runat="server" src="Image/FlowArrow.gif" Width="54" Height="31" Style="margin-top: 23px" /> </div> </SeparatorTemplate> </asp:Repeater><%#((bool)Eval("isActive"))? "<tr align='center'><td><small>(You are here)</small></td></tr>" : ""%> This line is throwing error. bool is not taking heresen338
Member
498 Points
118 Posts
Re: Repeater HTML not working.
Jan 07, 2013 09:48 PM|LINK
'<%# (Boolean.Parse(Eval("Active").ToString())) ? "Yes" : "No" %>'
<%# ((int)Eval("Locked")) == 1 ? true : false %>
ramll
Participant
1127 Points
1299 Posts
Re: Repeater HTML not working.
Jan 07, 2013 09:59 PM|LINK
Before YES, Under question mark, it is showing. This character cannot be used here.
oned_gk
All-Star
31766 Points
6493 Posts
Re: Repeater HTML not working.
Jan 08, 2013 12:13 AM|LINK
<%# Eval("isActive") == True ? "<tr align='center'><td><small>(You are here)</small></td></tr>" : "" %>try above
ramll
Participant
1127 Points
1299 Posts
Re: Repeater HTML not working.
Jan 08, 2013 01:32 PM|LINK
This is also not working. It is throwing syntax error at "==" and in the last ""
kszymaniak
Member
205 Points
112 Posts
Re: Repeater HTML not working.
Jan 08, 2013 04:04 PM|LINK
It's strange that HTML code which working on VS 2008, not working on VS 2010. Maybe there is various Framework version on VS 2010. I don't know, check it.
Also
<%# Eval("isActive") == True ? "<tr align='center'><td><small>(You are here)</small></td></tr>" : "" %>word "TRUE" in above code ; is it string, value, what is type?
if "true" is string that should be:
<%# Eval("isActive").ToString() == "True" ? "<tr align='center'><td><small>(You are here)</small></td></tr>" : "" %>ramll
Participant
1127 Points
1299 Posts
Re: Repeater HTML not working.
Jan 08, 2013 07:09 PM|LINK
Hi,
I think the issue with C# and Vb.Net. It is working in C# but not in vb.net
Can you give me the equivalent code in vb.net
oned_gk
All-Star
31766 Points
6493 Posts
Re: Repeater HTML not working.
Jan 09, 2013 12:21 AM|LINK
try this in VB
<%# IIF(Eval("isActive"),"<tr align='center'><td><small>(You are here)</small></td></tr>","") %>