A
AJ
Hi,
I'm trying to customize the Menu navigation control so that the the static
items have two lines. The first line will be the text (for example "About
Us"), and the second line will be a short description. Also, I have a method
in my class that accepts a string and returns the description required.
Here is what I have on the aspx file:
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
<DynamicItemTemplate>
<%# Eval("Text") %><br />
</DynamicItemTemplate>
<StaticItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Text")
%>'></asp:Label>
<br />
<asp:Label ID="Label2" runat="server"
Text= '<%# GetDescriptionFromTitle(Eval("Text"))
%>'></asp:Label>
</StaticItemTemplate>
</asp:Menu>
As you can see above, the Static Item's second line (Label2) calls the
GetDescriptionFromTitle method. However, the problem I'm facing is that I
can't get it to accept the Eval("Text") as the parameter to this method.
The errors I recieve are (they point to the aspx file):
Error 1 The best overloaded method match for
'_Default.GetDescriptionFromTitle(string)' has some invalid arguments
Error 2 Argument '1': cannot convert from 'object' to 'string'
Any idea what I'm doing wrong?
Appreciate any help or pointers.
Thanks,
AJ
I'm trying to customize the Menu navigation control so that the the static
items have two lines. The first line will be the text (for example "About
Us"), and the second line will be a short description. Also, I have a method
in my class that accepts a string and returns the description required.
Here is what I have on the aspx file:
<asp:Menu ID="Menu1" runat="server" DataSourceID="SiteMapDataSource1">
<DynamicItemTemplate>
<%# Eval("Text") %><br />
</DynamicItemTemplate>
<StaticItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Eval("Text")
%>'></asp:Label>
<br />
<asp:Label ID="Label2" runat="server"
Text= '<%# GetDescriptionFromTitle(Eval("Text"))
%>'></asp:Label>
</StaticItemTemplate>
</asp:Menu>
As you can see above, the Static Item's second line (Label2) calls the
GetDescriptionFromTitle method. However, the problem I'm facing is that I
can't get it to accept the Eval("Text") as the parameter to this method.
The errors I recieve are (they point to the aspx file):
Error 1 The best overloaded method match for
'_Default.GetDescriptionFromTitle(string)' has some invalid arguments
Error 2 Argument '1': cannot convert from 'object' to 'string'
Any idea what I'm doing wrong?
Appreciate any help or pointers.
Thanks,
AJ