Solved

ASP.net Details View visability property

Posted on 2012-04-10
2
291 Views
Last Modified: 2012-04-12
I have this code in a Details view on my page.

<asp:BoundField DataField="txt_BUS_EMAIL" HeaderText="txt_BUS_EMAIL" SortExpression="txt_BUS_EMAIL" Visible='<%# Eval("txt_BUS_EMAIL").ToString().Equals() %>' />

When I go to run it, I get his error:

Databinding expressions are only supported on objects that have a DataBinding event. System.Web.UI.WebControls.BoundField does not have a DataBinding event.

Please advise if any of you have encountered this before!

Thank you in advance!
0
Comment
Question by:us1975mc
2 Comments
 
LVL 20

Accepted Solution

by:
BuggyCoder earned 500 total points
ID: 37829975
i would suggest two things here:

1. use a template field
2. make a method GetStatus in your code behind that returns true or false, call it in template field as <%#GetStatus()%>

also refer here for help:-
http://www.asp.net/web-forms/tutorials/data-access/custom-formatting/using-templatefields-in-the-detailsview-control-cs
0
 

Author Closing Comment

by:us1975mc
ID: 37837437
Thanks for the help!
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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

932 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

10 Experts available now in Live!

Get 1:1 Help Now