开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜