Solved

Changing databinder attributes before databind

Posted on 2013-01-07
1
201 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Need an intro to -- .Net SQL Authorization Manager 7 80
ASP.Net Session State alternatives 3 61
ASP.NET 5 Templates 2 68
Error in JQuery 5 39
I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

864 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

22 Experts available now in Live!

Get 1:1 Help Now