Solved

Changing databinder attributes before databind

Posted on 2013-01-07
1
204 Views
Last Modified: 2013-01-09
Please see attached:

I have a databinder in my asp.net 2.0 code.

I want   to hide/remove a line of code as marked depending on the stylesheet I have
selected.

I want to do this in my c# code before I do my databind.

Your assistance is appreciated.

Thanks,
Isaac
databindcode.txt
0
Comment
Question by:TechIsaac
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 11

Accepted Solution

by:
madgino earned 500 total points
ID: 38752453
It really depends on your "stylesheet" condition, how that look like.

The easiest would be to put your line in an extra if like below but depending on your condition there could be better solutions:

<% if your_condition then%>
<%# DataBinder.Eval(Container.DataItem, "WLFlag").ToString() == "True" ? "<img src='images/icon_w.png' height='14' width='14' />" : ""%>
<% end if%>
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question