![]() |
|
|
|||||||
![]() |
ASP Net - DataBinder.Eval(Container.Item, "myDownloadFile") Question |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Hey
Okay using DataBinder.Eval in a repeater. My question is this - if the value is empy, eg the 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 Chris |
|
|
|
|
#2 |
|
Posts: n/a
|
Hi, Chri
Databinding on aspx page cannot contain complicated logic You can achieve that in the Repeater's ItemDataBound Event void R1_ItemDataBound(Object Sender, RepeaterItemEventArgs e) if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) if (e.Item.DataItem("myDownloadFile") == String.Empty) ((Label)e.Item.FindControl("myDownloadFile")).Text = "No download file available" } =?Utf-8?B?QmluIFNvbmcsIE1DUA==?= |
|
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Dial-up Modem Question | w_tom | A+ Certification | 0 | 09-18-2005 09:12 PM |
| "Installing two drives" question - what next? | Jim | A+ Certification | 12 | 08-07-2005 01:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | God | DVD Video | 3 | 04-25-2005 04:19 PM |
| Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good | Filthy Mcnasty | DVD Video | 0 | 04-25-2005 04:29 AM |
| Re: Safe Mode Question (A+ question) | Gordon Findlay | A+ Certification | 0 | 06-16-2004 10:48 AM |