• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 214
  • Last Modified:

Changing databinder attributes before databind

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

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

Your assistance is appreciated.

1 Solution
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%>
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now