A blog about SharePoint, Project Server and other Microsoft technologies.

Tuesday, October 1, 2013

SharePoint - Create Top Navigation menu programatically

In my previous post, I wrote about creating Quick Launch navigation programmatically . In this post, I will show how to create Top Navigation programmatically. It is easy since the code is almost the same as for Quick Launch.Top Navigation is
navigation located on the top of the screen and it is important
part of almost every SharePoint site (marked in red square on the
image).

SharePoint Top Navigation

The code is very
simple, it consists of reading the Top Navigation object and deleting the
existing links in it. And then, after the existing Top Navigation is
cleared, putting the new links which we have read from some text file.