Hello,
I have a navigation bar in a datalist and I am trying to be able to specify what I want to display depending on the value i pass through a variable. Let me explain you what I have so far:
I have a simple navigation file (i.e. navigation.ascx)
with this :
<ASP
ATALIST id="MyDataList_Navigation" runat="server" AutoGenerateColumns="false" width="100%">
<itemtemplate>
<table cellSpacing="0" cellPadding="0" border="0" width="100%">
<% If sname = "al1" Then %>
<tr>
<td><img src="arrowdown.gif"><A class="shadow" href="<%# DataBinder.Eval(Container.DataItem, "URL") %>"><%# DataBinder.Eval(Container.DataItem, "Name") %></A></td>
</tr>
<% Else %>
<tr>
<td><img src="arrowup.gif"><A class="blue" href="<%# DataBinder.Eval(Container.DataItem, "navbarURL") %>"> <%# DataBinder.Eval(Container.DataItem, "navbarName") %></A></td>
</tr>
<% End If %>
</table>
</itemtemplate>
</ASP
ATALIST>
then I have different files where I call the navigation bar like this:
<MyTest:Navigation id="Navigation1" sname="al1" runat="server"></Facility:LeftBar>
<MyTest:Navigation id="Navigation1" sname="al2" runat="server"></Facility:LeftBar>
etc.. you get the idea
but now I am thinking that I have several different sections in my navigation bar and I cannot say <% If sname = "al1" Then %> for each one, that just wouldn't make sense. Does anyone knows an alternative way to what I am trying to achieve? each section calls the navigation.ascx and pass a variable (sname) value to it. I just need to be able to compare that value with the datalist result that comes from the database and if it matches then I show an arrowdown. Apparently supposed to be a simple thing
I have a navigation bar in a datalist and I am trying to be able to specify what I want to display depending on the value i pass through a variable. Let me explain you what I have so far:
I have a simple navigation file (i.e. navigation.ascx)
with this :
<ASP
<itemtemplate>
<table cellSpacing="0" cellPadding="0" border="0" width="100%">
<% If sname = "al1" Then %>
<tr>
<td><img src="arrowdown.gif"><A class="shadow" href="<%# DataBinder.Eval(Container.DataItem, "URL") %>"><%# DataBinder.Eval(Container.DataItem, "Name") %></A></td>
</tr>
<% Else %>
<tr>
<td><img src="arrowup.gif"><A class="blue" href="<%# DataBinder.Eval(Container.DataItem, "navbarURL") %>"> <%# DataBinder.Eval(Container.DataItem, "navbarName") %></A></td>
</tr>
<% End If %>
</table>
</itemtemplate>
</ASP
then I have different files where I call the navigation bar like this:
<MyTest:Navigation id="Navigation1" sname="al1" runat="server"></Facility:LeftBar>
<MyTest:Navigation id="Navigation1" sname="al2" runat="server"></Facility:LeftBar>
etc.. you get the idea
but now I am thinking that I have several different sections in my navigation bar and I cannot say <% If sname = "al1" Then %> for each one, that just wouldn't make sense. Does anyone knows an alternative way to what I am trying to achieve? each section calls the navigation.ascx and pass a variable (sname) value to it. I just need to be able to compare that value with the datalist result that comes from the database and if it matches then I show an arrowdown. Apparently supposed to be a simple thing