Hi,

I am new to Sharepoint 2010. I am working to obtain sites from collection list and libraries from site. I have been able to it by static values of site. But, the problem is that i need to populate a dropdown consisting of library, from the value of dropdown for site.

I can get the name of the site. But, my site is deployed to run on "http://myserver:8000/SiteName"

This "http://myserver:8000" I am able to obtain in one method, via making an instance of SPSite in SPSiteCOllection and getting URL.
But, I am unable to obtain it in the method I state below it, where, i need to dynamically construct the URL and pass the value in using statement.

I hope its not confusing. Kindly help please. M trying all I can since last week. Unable to crack. Please help.

Perhaps this code will help you, found at SharePoint Code Snippets by Sudarsan

Example- Get Full Url Of A SharePoint List

SPUtility.GetFullUrl(SPContext.Current.Site, listobj.DefaultDisplayFormUrl);

Example- Get Full Url Of A SharePoint ListItem

SPUtility.GetFullUrl(SPContext.Current.Site,"/"+ itemobj.Url);
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.