开发者

StartingNodeUrl - Is it possible to use a Method to set it's value programmatically?

开发者 https://www.devze.com 2022-12-13 10:12 出处:网络
From my Content MasterPage I want get the StartingNodeUrl and programmatically set it: Example of what I\'m trying to do:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号