locked
PageResultResponseControl.TotalCount in DirectorySevice RRS feed

  • Question

  • Hello,

    PageResultRequestControl prc = new PageResultRequestControl(50);

    mySearchRequest.Controls.Add(prc);

    ..

    ..

    // Send Request and Get Response..

    PageResultResponseControl prrc = ...

    //prrc.TotalCount   -> Why it returns always 0?

    I was thinking this is necessary to calculate the total page count..how do I get this value?

    Thanks,


    • Edited by T J Friday, August 1, 2014 4:21 PM
    Friday, August 1, 2014 4:21 PM

All replies

  • Hello,

    >>I was thinking this is necessary to calculate the total page count..how do I get this value?

    Do you try to query the AD with SearchOptionsControl(SearchOption.DomainScope)? According to this post, it to perform a paged search against the domainDNS container, you need to add

    SearchOptionsControl(SearchOption.DomainScope)

    So something like:

    SearchOptionsControl soc = new SearchOptionsControl(SearchOption.DomainScope);
    
    request.Controls.Add(soc);
    

    is required.

    If this does not work for you, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 4, 2014 7:33 AM
  • That won't make any difference.

    Still 0

    Monday, August 4, 2014 1:14 PM
  • Hello,

    Do you try query AD with not filer condition as "(objectClass=*)" to check whether there are records?

    And could you please share detail code with us?

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 5, 2014 7:39 AM
  • I don't have any issue to get the records.

    The issue is the TotalCount...I am not able to get the TotalCount like I said in the original post.

    You can even try to use same code in the site you mentioned above..and see what the TotalCount comes out..It will be 0.

    Tuesday, August 5, 2014 1:15 PM
  • Have u had any chance to take a look at this issue further?
    • Edited by T J Thursday, August 7, 2014 4:19 PM
    Thursday, August 7, 2014 4:07 PM
  • Hey Fred,

    Anything?

    Monday, August 11, 2014 1:21 PM
  • Maybe if you provide your detail code, it would be more helpful to understand your issue.
    Wednesday, August 27, 2014 7:18 AM
  • Again , I am not using my own custom code at all.

    have you even tried yourself?

    You can get any sample code on the internet..I am sure you already googled and found some paging example code...Try that code ..and see

    Whenever you are going to access TotalCount, you will see the issue.

    Wednesday, August 27, 2014 1:48 PM