Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ASP.net Details View visability property

Posted on 2012-04-10
2
Medium Priority
?
316 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 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

916 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