views:

145

answers:

1

From my Content MasterPage I want get the StartingNodeUrl and programmatically set it:

Example of what I'm trying to do:

<'asp:SiteMapDataSource ID="SiteMapDataSource1" StartingNodeUrl="<%= SomeMethod()%>" runat="server" />

but that gives the error:

Could not find the sitemap node with URL '<%=SomeMethod() %>'.

Is it possible to do this?

+1  A: 

I think you want to do the following in codebehind, for example in the Page_Load():

SiteMapDataSource1.StartingNodeUrl = SomeMethod();

You cannot use runat=server and <%= %> in one control in an asp.net file.

Webleeuw