Solved

Changing databinder attributes before databind

Posted on 2013-01-07
1
200 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
1 Comment
 
LVL 11

Accepted Solution

by:
madgino earned 500 total points
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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 …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now