Solved

ASP.net Details View visability property

Posted on 2012-04-10
2
289 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

758 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

19 Experts available now in Live!

Get 1:1 Help Now