.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Get SPSiteDataQuery result item URLs

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :SharePoint
Hi All, We’ve written some code to roll-up content from a site collection using SPSiteDataQuery. One of the challenges we ran into was constructing a valid URL for our results. E.g. converting one of the returned URL values like this: 1;#Lists/testlist/1_.000 Into something that we can use as a web hyperlink like this: /Lists/testlist/DispForm.aspx?id=1 At first this didn’t seem too bad – some simple string manipulation. But after adding logic to cater for the following types of issues: - Documents in document libraries, list items - Items in the root folder and sub folders - Site collections that are in the root of the web application and those under the “sites” folder - List items with custom display forms The end result is some pretty nasty (but functional) code. Just wondering if there is an easier way to do this (e.g. a site column we can use in the SiteDataQuery or an API method that we have overlooked)? Cheers, Keith

View Complete Post

More Related Resource Links

On New Item form, select item on choice dropdown based on query result.


I posted this on Experts Exchange awhile back with no answer, so here's hoping someone here has an idea :)

So I've mostly figured this problem out, but I need some help in getting over the hump... note that I'm using JavaScript to do this (SPServices) on SharePoint 07'.

I'm on the New Items page of a list. Based on a user's selection in a "Teacher" dropdown, I'm doing the following:

1.) Get the value of the Teacher field and several other fields (School and Visit Date)
2.) Run a CAML query based on those fields to find the last list item entered for that Teacher

So here's where I'm stuck...

I have 10 choice fields, all with choices 0, 4, 7, and 10. Depending on what they were set to in the last entered item (which I queried), I want to set the selected item on each of those dropdowns to equal that. So "Score 1" was set to "4" on the la

View : Tagged item Result : Tag cloud Problem

When you click on a tag in a webpart. It directs us to a new page for listing all the items associated with the Tag. In that page, there are two options to View the result - ALL and Popular within 60 days.

In ‘All’ tab it says - There are no available items tagged with 'keyword'
But on clicking ‘Popular within last 60 days’, it displays the items.
So why does it say 'no items tagged' in All tab.? Why the functioning of this all tab is different ?

Is there any way i can disable this All

Getting Item GUID in search result



I'm using the search.asmx webservice for querying Sharepoint Server 2007 / 2010. Getting managed properties and the URL is no problem. But I need the item GUID, too. How can I get the GUID directly in the resulting XML search result? Can I add the GUID to the managed properties?

Thank for your help,


Unique Permission on every individual item in a SharePoint Form Library can result in very slow perf


Hi All,

I just want to know that can sharePoint performance become slow by assigning unique permission on every individual item ? I have a form library in which there are hundreds of items and every item has unique permissions.

FYI: I read the following blogs and they are of the opinion that SharePoint performance can become horribly slow by assigning unique permissions

URL 1: http://sharepointbergen.blogspot.com/2008/09/sharepoint-2007-item-level-security.html

URL 2: http://weblogs.asp.net/erobillard/archive/2008/09/11/sharepoint-security-hard-limits-and-recommended-practices.aspx

Any help in this regard will be greatly appreciated..




Muhammad Tariq khan

binding to item template label of a gridview from stored procedure result of common column names


hi  my stored procedure contains a joining result of different tables with common column name to a dataset result can bind to gridview

as follows

CREATE proc SppShowStock 

select p.id, p.ProductId,  p.ProducName,  sh.CompanyName ,  su.CompanyName

TblStock p inner join TblSupplier su on p.SupplierId=su.CompanyCode 
     inner join TblShipper sh on p.ShipperId=sh.shipperid   
           inner join  TblCategory c on p.Category=c.Id 


<asp:TemplateField HeaderText="id">
                    <asp:Label ID="lblid" runat="server" Text='<%# Eval("id") %>'></asp:Label>


i am little bit in confusi

Missing 'new item templates'


 Hi all,

          I am a 'newbie' to VWD and I am slowly working through the Basic Walkthrough Help files, and learning plenty along the way.

However, when I tried to create a new database in the LINQ control walkthrough I found that the option to create a new database is missing, and further investigation has found that many other new item templates are missing.

I am using a brand new machine with Windows 7 Ultimate and have enabled IIS and .NET from Control Panel-Programs-Turn Windows Features On-Off. I used the WPI to install all basic elements eg. IIS Components, SQL Server Express.

The only 'new item templates' I have when I right-click the App_Data Folder and choose 'new item' are:-

ADO.NET Data Service

AJAX Enabled WCF Service

Dynamic Data Field

SQL Server Database

Text File

XML File

Does anyone know where I have gone wrong.


Michael J. Hill

removing item from datatable


hi to all ..thanks in advance


I have Two datatables dtA,dtB ,both contains column name is "FiledName" I need to remove item

from dtA when same row data exists in dtB.  please tell me how to do it

dtA    dtB   

 A        A

 B        F

 C        C

 D        Z

I want o/p like this







LINQ to SQL - Validating if item is in Database, but if item is not items not inserting into databas



I am new to this, so bear with me.  I am writing an application in C# that uses LINQ to validate a datacontext off a textbox to see if the record exists already.  If the record does exist I inserted an if statement to advise the user that the record exists, if the record does not exist I would like to allow the record to be added to the database.  If I take out my else statement everything works fine as far as inserting goes, but I do not want to allow inserts in this scenario.  I have tried moving the if and else statement to different parts of the code but can't quite figure this one out.  Any help would be apprecaited, attached is the code.  This code is set to a button press.  As a matter of fact, if you see any other errors along the way please feel free to point them out. 



    protected void enterBTN_Click(object sender, EventArgs e)
        //make new data context

        SHCDataContext insNewAll = new SHCDataContext();
        //LINQ to check if customer exists in database
        var checkExisting = from c in insNewAll.Customers
                            where c.custLastName.Contains(custLastNameTB.Text.ToString())
                            select c.custLastName;
        //make list to store values

Active Directory and .NET: paging the search result

Hi everybody!

I have a question about Active Directory in .NET
For my project I need to fetch results from Active Directory search page by page, because later I would need to bind it to the pageable DataGrid.

I tried to use .NET library DirectoryServices for that, but paging provided by this library is transparent to the user and is used only to increase the efficiency of searching, when results are too big. I.e. I cannot tell the DirectorySearcher to give me first page, then the next or previous page, it returns me all resulting pages in one bundle.

However, what I need is to explicitely get page after page directly from the AD searcher and to be able to go at least one page forward or backward.

The solution with copying all results to the DataBase and then do the paging is not accepeted by the clent, since it is too inefficient. And since it's a Web app, I cannot keep results in memory either.

I found some hints about COM Interface, but I could not find good and detailed examples or explanations. I aslo found this line of code: DirectoryServices.Interop.IDirectorySearch.ExecuteSearch(), but I don't know which libraries should i add to be able to compile this code.

If somebody could help me out with that problem, any suggestion is welcome, 'cause this issue is eating me alive :)

Thank you!

How to keep the hover for Parent menu and set the selected menu item css for child menu item?



I'm using cssfriendly control adapter for menu. My asp.net menu control's datasource is a sitemap file I'm using which contains all the urls.

I have the following questions:

  1. Is there a way to keep the parent menu item hovered while hovering over the respective child menu items?
  2. Is there a way to keep the child menu item selected? I am able to set the css for the parent menu, however I was wondering if the same is possible with the child items.

Please help! Smile


Moneka Smile

Team System: Work Item Tracking


In this column, Brian Randell explains how to build a simple Work Item explorer and demonstrates the core operations needed to add work item support when building your own add-in.

Brian A. Randell

MSDN Magazine April 2007

Visual Studio 2005: Create Reusable Project And Item Templates For Your Development Team


Visual Studio 2005 introduces a new model that lets you define your own project templates and starter kits, something developers have been requesting for some time. Here Matt Milner shows you how to consume, create, and customize these templates.

Matt Milner

MSDN Magazine January 2006

Inside MSDN: Designing URLs for MSDN2


This is the first installment of a new column about MSDN® projects: what we're doing, how we're doing it, and what we're learning along the way. It will be written by MSDN staff with the goal of sharing the team's experiences in solving the real-world business problems MSDN faces.

Tim Ewald

MSDN Magazine February 2005

ASP.NET 4.0 Menu Top Level selected item style


I want to apply a css class to the level 1 menu item (parent) when it or any or it's children are selected.

I've looked at MSDN documentation and any number of examples and walkthroughs but I haven't come up with a way of managing this. I was thinking something like this might work but the style is not being applied to the parent. To further complicate matters, if I try to apply a css style to StaticSelectedStyle it doesn't pick it up at all.

Menu Markup:

<StaticSelectedStyle  Font-Bold="True" ForeColor="#3333CC" />

Code Behind:

        protected void MenuItemClick_NavMenu(Object sender, MenuEventArgs e)


            MenuItem parentItem = e.Item.Parent;

            if (parentItem != null)


                parentItem.Selected = true;



problem...i want a list item to populate all data in gridview!!!


i have a dropdownbox and a gridview

what I want is to have a list item which populates all data in a gridview.

I have tried using list item selected value=0 but to no avail.

what is the easiest way to achieve this?

show sub item to user



         I have a form where I took 2 dropdownlists. In 1st ddl I displayed all Religions and in 2nd DDL I displayed related castes. When my user filled the form so everything saved it. But when user logged in I unable to show him his choosen caste. Religion I displayed throgh RellgionId. But I don't understand how to do that?


      Can anyone tell me where I am doing mistake?



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend