Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

VariationDataSource - get single value out

$
0
0

If I have something like this in my code:

<asp:DataList id="DataList1"
CellPadding="3"
Font-Size="8pt"
RepeatDirection="Horizontal"
runat="server"
DataSourceID="LabelMenuDataSource" ><ItemTemplate><a href="<%# DataBinder.Eval(Container.DataItem, "NavigateUrl") %>"><%# DataBinder.Eval(Container.DataItem, "DisplayText") %></a></ItemTemplate><SeparatorTemplate> | </SeparatorTemplate></asp:DataList>

I want to check to see if NavigateUrl contains a certain value, if it does then I want to act on it. I don't know much about Eval to be honest. I was hoping to do something like this

string url = DataBinder.Eval(Container.DataItem, "NavigateUrl")

and then use the url variable as normal but it doesn't like that.  I suppose my question is how do I get just a single value from this LabelMenuDataSource so I can then manipulate it?

Thanks

DavidgCCC


Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>