0

Hi,

How do I programatically find the GUID for the Sharepoint List View given that the name of the view is known. A user has to input the view name and the program should be able to spit out its GUID.

Thanks.

2
Contributors
3
Replies
6
Views
5 Years
Discussion Span
Last Post by SummerNight
0

Thanks Momerath. I have been trying to use that page as a help before I posted here. No Luck! I have no idea how to implement it in my code and what libraries to import to make it work.

0

Well I figured it out. For anyone who might stumble upon this problem in the future. here's the solution :

                SPWeb web = SPContext.Current.Web;
                SPList list = web.Lists["your-list-name"];
                Guid viewId = list.Views["your-view-name"].ID;
                some_random_label.Text = "The view GUID is :" + viewId.ToString("B");
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.