473,466 Members | 1,349 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to hide this?

Hello,

I have this in a Repeater on na Asp.Net page:
<a href='<%# DataBinder.Eval(Container.DataItem, "link") %>'>Go</a>

How to hide everything is the link field is empty?

Thanks,
Miguel

Nov 19 '05 #1
2 1196
I'd just add check for the link being empty, and if it's true then set the
style "display:none" within the "<a>" tag. It would look like this:
<%
//Define a function to check the value and return the "none" or ""
attribute for "display"
string HideLink ( val )
{
return (val== null || val=="")?"none":"");
}
%>

<a href='<%# DataBinder.Eval(Container.DataItem, "link") %>'
style='display:<%=HideLink(# DataBinder.Eval(Container.DataItem, "link") )%>
Go</a>
I haven't tested it, so I'm not sure about the syntax, but just try it.

Azat

"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> schrieb im Newsbeitrag
news:Op**************@TK2MSFTNGP14.phx.gbl... Hello,

I have this in a Repeater on na Asp.Net page:
<a href='<%# DataBinder.Eval(Container.DataItem, "link") %>'>Go</a>

How to hide everything is the link field is empty?

Thanks,
Miguel

Nov 19 '05 #2
Choices:

1. Filter the data to ensure only those with valid links are bound.
2. Move away from declarative binding and create the links programatically
and then bind them to a container (panel comes to mind).
3. If this is a single row, you can make the repeater invisibible when the
value is empty.

These are the first ideas that come to mind. Of the ideas, #1 is my favorite
as it filters out junk and does not process it at all.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Shapper" wrote:
Hello,

I have this in a Repeater on na Asp.Net page:
<a href='<%# DataBinder.Eval(Container.DataItem, "link") %>'>Go</a>

How to hide everything is the link field is empty?

Thanks,
Miguel

Nov 19 '05 #3

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

Similar topics

2
by: John M | last post by:
I want to hide the first row in my table and if a user click on a show button than show it. If it is visible than user can hide it with click a hide button. In default I hide it with: <tr...
12
by: Jochen Daum | last post by:
Hi! I have a dynamically generated page (PHP), which contains an Explorer like view of items. I would like to hide multiple <tr>'s by name, but I can't figure out how thats done. I have this...
19
by: benzwt | last post by:
I use the following function to hide a <div> named one. function hideObject() { if (ns4) { document.n1.visibility = "hide"; } else if (ie4) { document.all.style.visibility = "hidden"; }...
0
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
8
by: Kejpa | last post by:
Hey there! I have a tabcontrol on one of my forms. Some of the tab should not be accessable (and thus invisible) until you give the correct password. But I can't hide the tab......
7
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
5
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
1
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
6
by: Ralph | last post by:
Hi, I was reading effictive C++ and some other books again and they all tell you about hiding implementation details (proxy/pimpl/inheritance) but they never really explain when to use it. I...
2
by: richard | last post by:
In using the simple code below, how do I tell it NOT to hide a division when the link is clicked on if that division is already visible? would it be as simple as using a 2nd function and setting...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.