473,326 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Bind with a condition

I want to do show this:

<asp:Panel id="Panel1" runat="server">
<div>Product dimensions: <%# DataBinder.Eval(Product, "Dimensions") %></div>
</asp:Panel>

Only if "Dimensions" field is not empty.
Is there any way?

The best I think is to do this in the DataBinding Event of the panel

if (Product.Dimensions == "")
divDimensions.Visible = false;

Of course, giving the div tag an id of divDimensions and the runat="server"...
Is there another way?

Thans!!

--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

Nov 19 '05 #1
2 2441
That's the best way, check out: http://openmymind.net/databinding/index.html
for detailed information.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Marcelo Hernán Ruiz" <ma*****@centraldev.net> wrote in message
news:2004120411411628583%marcelo@centraldevnet...
I want to do show this:

<asp:Panel id="Panel1" runat="server">
<div>Product dimensions: <%# DataBinder.Eval(Product, "Dimensions") %></div> </asp:Panel>

Only if "Dimensions" field is not empty.
Is there any way?

The best I think is to do this in the DataBinding Event of the panel

if (Product.Dimensions == "")
divDimensions.Visible = false;

Of course, giving the div tag an id of divDimensions and the runat="server"... Is there another way?

Thans!!

--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

Nov 19 '05 #2
Thanks!! That was a very good article!!!

On 2004-12-04 18:36:53 -0300, "Karl Seguin" <karl REMOVE @ REMOVE
openmymind REMOVEMETOO . ANDME net> said:
That's the best way, check out: http://openmymind.net/databinding/index.html
for detailed information.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Marcelo Hernán Ruiz" <ma*****@centraldev.net> wrote in message
news:2004120411411628583%marcelo@centraldevnet...
I want to do show this:

<asp:Panel id="Panel1" runat="server">
<div>Product dimensions: <%# DataBinder.Eval(Product, "Dimensions")

%></div>
</asp:Panel>

Only if "Dimensions" field is not empty.
Is there any way?

The best I think is to do this in the DataBinding Event of the panel

if (Product.Dimensions == "")
divDimensions.Visible = false;

Of course, giving the div tag an id of divDimensions and the

runat="server"...
Is there another way?

Thans!!

--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

--

Marcelo Hernán Ruiz
--------------------------------------------------
Centraldev.net
Diseño, Desarrollo y Consultoría Tecnológica
Web: www.centraldev.net

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Clarence Gardner | last post by:
I've got a problem that I don't see how to program around. A socket server that was running fine, today started getting an exception from the bind() call (errno 22, Invalid argument) and yet the...
1
by: Achille Carette | last post by:
Hello all, I noticed a difference in the explain plans between JDBC using bind variables (PreparedStatement) and SQLPlus for the same query. The query made through JDBC using bind variables...
2
by: P G | last post by:
I hope this is on topic here. I have a problem compiling a simple example of the use of boost::bind. Please take a look at the program below. ...
4
by: Arturo Cuebas | last post by:
The program below contains a compile error. Following the program you will find the typical fix then my idea for a library that facilitates a more elegant fix. #include <boost\bind.hpp> using...
4
by: Emre Guldogan | last post by:
Hello, In C#, We can read data fields from DB with <%# DataBinder.Eval(Container.DateItem,"field_name") %> but, How can I check a value from DB with a <%# .. %> segment such as <%# If(...
5
by: ABSMunkee | last post by:
I have a vb.net dll that has two functions: one allows a user to change their password in AD, the second allows the user to view their distinguishedname (based on their samaccountname). Both bind...
3
by: Nicolas Boretos | last post by:
Hello, Beginning access user here. I am displaying the table and its existing form at the same time. I would like to double-click on a row in the table and have the form go to/display the...
3
by: =?iso-8859-1?B?Tm9yZGz2dw==?= | last post by:
Hey there, C++ Coders! I am learning multi-threading with boost and have come up with the following code example shown below. This example implements a test of the producer-consumer design...
1
by: PravinThanusu | last post by:
Hi Friends, I am struggling to solve this, please help me solve this I am having two columns in my database, item and condition Item codition Value1 1 Value2 0 Value3 0...
2
by: akshalika | last post by:
Hi, I have a repeater control. it dynamically bind textbox or dropdown base on some condition. i want to bind required field validator dynamically for validate textbox or dropdown. here is my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.