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 '<开发者_StackOverflow中文版%=SomeMethod() %>'.
Is it possible to do this?
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.
精彩评论