473,387 Members | 1,834 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,387 software developers and data experts.

Help!! i'm stuck in a big way

Hey - sorry for the double post - but i'm really stuck and needing to fix
this quicksmart.

Okay using DataBinder.Eval in a repeater.

My question is this - if the Container.Item value is empy, eg myDownloadFile
is empty,
how can i display different output than if it was populated.

# pretend code
<% if DataBinder.Eval(Container.Item, "myDownloadFile) == String.Empty) { %>
Now download file is available
<% } else { %>
Click here to download <%# DataBinder.Eval(Container.Item, "myDownloadFile")
%>
<% } %>

How can i achieve this ? i believe i could use a terniary but thats well
nasty :)

<%# DataBinder.Eval(Container.Item, 'Example') != String.Empty ? "download
bleh" : "no download" %>

You help is must appreciated :)
Thanks
Chris
Nov 18 '05 #1
1 1019
Chris,
I would solve this problem by wrapping the DataBinder.Eval call in a
method that returns a string. Define this method in your page code.
<%#MyMethod(DataBinder.Eval(Container.Item, "myDownloadFile"))%>

public string MyMethod(string myVar){
if(myVar == string.Empty){
return "No download file is available.";
}else{
return "Click here to download . . .";
}
}

Best Regards,
Jeffrey Palermo

"Chris" <ch***@no-spam.tuxweb.org> wrote in message
news:10*************@corp.supernews.com...
Hey - sorry for the double post - but i'm really stuck and needing to fix
this quicksmart.

Okay using DataBinder.Eval in a repeater.

My question is this - if the Container.Item value is empy, eg myDownloadFile is empty,
how can i display different output than if it was populated.

# pretend code
<% if DataBinder.Eval(Container.Item, "myDownloadFile) == String.Empty) { %> Now download file is available
<% } else { %>
Click here to download <%# DataBinder.Eval(Container.Item, "myDownloadFile") %>
<% } %>

How can i achieve this ? i believe i could use a terniary but thats well
nasty :)

<%# DataBinder.Eval(Container.Item, 'Example') != String.Empty ? "download
bleh" : "no download" %>

You help is must appreciated :)
Thanks
Chris

Nov 18 '05 #2

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

Similar topics

3
by: Yeren | last post by:
We run a website with pages that are created using ASP. The website is used by different people from different networks. For some people, the pages are stuck. It looks like the were able to open...
8
by: MLH | last post by:
I use a mouse-down procedure to trap right mouse clicks and CTRL-Right mouse clicks. Running the procedure must put honey or some other sticky substance into my keyboard because subsequent...
1
by: jessebasketball | last post by:
i am a very beginner programmer and am stuck on a very simple problem. I am trying to make a game where the user is presented with a scenerio and options. ie you are standing in the parking lot...
5
by: Mike D | last post by:
Attached is my code. Which I know there is a better way of writing however this is what I came up with and it works until the value is null or not = to the <> value. 'Do While rdrSQL.Read() ...
2
by: rehet | last post by:
hye.. i really need ur guys help.. im stuck.. i want to count the word freq and print them according to the word length.. > the longest be output first.. ouh.. and my input must be alphabet or...
11
by: dorandoran | last post by:
Here is the db with sample data. http://download.yousendit.com/AAA18BC7520F196E I want to use qryCrosstab and table "ALL" to achieve the result that would look like this query "qryFinalResult"....
4
by: =?Utf-8?B?TWF1cg==?= | last post by:
My cd is stuck in the drive. I can open the drawer O K but the c d will not come out Help me please -- Maur
1
by: skippychalmers | last post by:
Hey... new here. Could really use some help with a preg_split i'm trying to run. Basically, I have a string. In it is the tag: ''. Its a sort of bbcode feature I'm adding to a forum. There's...
1
by: =?Utf-8?B?VHJ1cHRpIERhbGlh?= | last post by:
Hi to all, I am new in this newsgroup and new to .NET also. I am creating an application where I have to perform Mail Merge from my program. I have created a form which contain RTB and user can...
2
by: manontheedge | last post by:
I've got two separate programs, one being the "server" and the other one (this one) being the "client". I've got the "server" to where it just sits and waits for connections, and sends out whatever...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.