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

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

how to get ListItems in Specific folder and not in subfolder ?

Posted By:      Posted Date: September 09, 2010    Points: 0   Category :SharePoint
Hi,  following query gives me the items in subfolder also, but i need items in specific folder only.   not in subfolder.   what needs to be modified?     string folderQuery = " <Contains><FieldRef Name=\"FileRef\" /><Value Type=\"Text\">" + folderName + "</Value></Contains>";                SPQuery query = new SPQuery();                               query.Query = "<Where><And>"+folderQuery+" <Eq><FieldRef Name='FSObjType'/><Value Type='Lookup'>0</Value></Eq><And></Where>";                                                                           query.RowLimit = 500;             &nbs

View Complete Post

More Related Resource Links

Possible to create sub folder under DynamicData/CustomPages/{table}/subfolder

Hi, Is there possibility to create a subfolder under   DynamicData/CustomPages/{table}/subfolder and way to redirect the pages to subfolder pages.

Folder and document specific permissions

My problem is that when I grant a user Read/Contribute permission to a document which is located in a folder in a library where I have not granted access to the user before. When the user is granted a Read/Contribute permission to the document the system creates a restricted permission to the library and to the folder where the document exists. But the problem is that the user can't access the file throught browser or Sharepoint Workspace. User can view the library but do not see the folder where the document is and in SharePoint Workspace the file is visible when syncing but the path to the file is wrong. Allthough user can find and access the file using a fileID.

View content of a specific folder in customized view


I would like to create a customized view (edit current view] that only shows the content of one specific sub folder of a document library. So far I have used meta data to show only specific content in a view, but I am wondering whether there is any easier solution, such as "filename" begins with ../../.../foldername

SP to fetch the specific file name in a specified folder



How to fetch a file name of specific  file type from a specified folder. To simplify

Assume 'Test.xxx'  is the file name in 'D:\test' folder. Need a sp which takes the drive as input parameter and fetch the output 'Test'.

Thanks in advance.

DataFormwebpart to display specific folder data of a List.



I am having one requirement where the DataFormwebpart should display specific folder data of a List. For an exxample I have one list which has three folders Level 1 , Level2 and Level3 . I want that when webpart is added on SharePoint page it should display data of Level1 and not the root level data of list. 

Basically the webpart needs to be drilled to Level1 folder by default rather than root folder of List.


setting up form authentication for a specific folder


I have an "Admin" folder in my application that will include pages that I would not like to have anonymous access to.  When a user attempts to load a page that resides in this folder, I would like to redirect them to a login page. Here is what I have in my config so far.


 <authentication mode="Forms">
      <forms loginUrl="~/Admin/Login.aspx" timeout="2880" >
        <credentials passwordFormat="Clear">
          <user name ="isaac" password="****"/>          
What do I need to add to get the functionality I am lookign for. Thanks




Viewing the content of a specific folder from a library in a webpart


Hello all!

I was wondering if anyone knew how to view the content of a specific folder from a library in a webpart?


Form level authentication on specific folder


Following is my directory structure of my web application which is also configured in IIS as virtual directory

Web Site Root

    |MasterPage (file)

    |Web Config (file)

    |Public Contents (directory)


    |Admin (directory)

               | Login.aspx


               |WebConfig file (need form security here)

How is configure my both web configs to solve my issue. currently i am getting following error

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level.  This error can be caused by a virtual directory not being configured as an application in IIS.

my root web config has default settings and my Admin directory has following settings


Button specific code


I have 2 submit buttons on my page. Right now, the only way to run the code behind with razor is to to If(IsPost). Since I have 2 buttons, how would I destinguish between the two in post? Is there a way to request a button that sent a post request?  

Getting list of users reporting from specific Manager from Active Directory


Dear All,

I am have requirement like displaying all the user information reporting to specific manager from Active Directory.

Please help me regarding this.



Create web site specific to mobile device, how to detect?



I have a website that is written in .Net 2.0 which uses all the nice rich functionality of the web (Ajax, javascript etc..).  However I have noticed that the site does not display very well on mobile devices. 

So therefore I would like to create a more streamlined version of my site that is better tailored to these devices.  However how do detect that the user has come to the site via a mobile device and how can i redirect them to my tailored page

Many thanks in advance

Patterns in Practice: Internal Domain Specific Languages


Jeremy Miller explains how internal Domain Specific Languages can help you craft code that is easier to read and write. His bag of tricks to improve your programming includes extension methods, fluent interfaces, object extensions and use of the semantic model.

Jeremy Miller

MSDN Magazine January 2010

Bugslayer: Minidumps for Specific Exceptions


This installment of Bugslayer covers the use of ADPlus to create a minidump of your Microsoft .NET Framework 2.0 pro¬cesses on specific exceptions.

John Robbins

MSDN Magazine November 2006

Copying files to a folder on web server



I have few files in FolderA on the web server.

I want the users to select a fews files from FolderA and copy them to FolderB on the same web server.

I want to list all the files in FolderA and allow the user to select a few files and copy.

I want to copy the files programatically when the user selects a few files and click on Copy button.

How to copy the files quickly from folderA to FolderB?




Add an empty line in Gridview on specific dayofweek


Hey all,

Havin quite a bit of trouble with this one.  I have a bunch of days that I worked in my database...mostly monday-friday and some saturdays.  What I want the gridview to do is add an empty line between each sunday and monday so that it seperates out my work weeks and makes it easier to read in the gridview.  I got some help here a few days ago on how to clone the db etc and I have all that working properly but I can't seem to wrap my head around how to do add these empty lines in the proper spots.  Here is my code so far:

private DataTable AddEmptyRow()
        DataTable originalDataTable = GetItems();
        DataTable newDataTable = originalDataTable.Clone();
        DateTime testdate = Convert.ToDateTime("7/20/2010");

            for (int i = 0; i < originalDataTable.Rows.Count; i++)
                DayOfWeek day = testdate.DayOfWeek;

                if (day == DayOfWeek.Sunday)
                    DataRow newDataRow = newDataTable.NewRow();



Do not see the table in Database after moving the project folder



I created a ASP.NET project under Visual Web Developer 2008. Under that project I had a Database (along with ASPNETDB.MDF) which has about 3/4 tables (I had SQL server 2008). Everything was working fine (like insert, delete, etc.). And I was able to view the tables in database explorer view.

Then I had to format my computer for some reason and I copied the whole project in a USB drive and then after formatting the computer I copied the folder and tried to open it in Visual Web Developer (now I have VWD 2010). I can see the both Database under App_Data folder (ASPNETDB.mdf and the DB I created). ASPNETDB has all the tables and data as expected. But I do not see the tables under the DB I created.

I also tried in one of my friends computer who has Visual Web Developer 2008. But same result.

I am just wondering if anyone can help me with retreiving the table. I have a bad feeling that I might needed to do something to backup the data (not sure though). But the tables should be still there ... isn't it ?

Any help will be appreciated. Thank you in advance.

Autoscroll down to a specific line on the webpage



I wonder about how this autoscroll is working on a page. For example when entering a page that I have set up named "test.aspx",

I want to 'autoscroll' down to a specific textrow that I have so that textrow exactly will be on the very top of the browser window.


I wonder how you do this task? Thanks! 

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