.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

Count the number of posts in a blog

Posted By:      Posted Date: April 10, 2011    Points: 0   Category :C#

We have a new blog site which contains the standard list called Posts.  We would like to display a webpart on our main blog page that returns a count of how many posts are in the Posts list.  Does anyone know if there is a block of code that I could put into a content editor webpart on my page to return this count? 

I found a post where someone said you could create a Data View using SPD and edit some code to return a count, but this didn't work for me.

View Complete Post

More Related Resource Links

How to display recent blog posts in marquee up tag?


I need to display recent blog post in the blog site to the right panel.

i am able to display all the title of the posts using dataview. What i need is that it should scroll up, that is all the contents should be in the : Marquee direction="up" tag.

how can i scroll the recent post's?


Blog site Restrictions -- How to set an expiration date on blog posts

I just created a new Blog site in Sharepoint 2007, and set permisions to the users and admins.
Now, I have a question on how to set the post life time. Is there any setting to contral how many days that the posts can last in the blog? We want the post include the comments kept in the site for one month.

Please help.


Cannot count number of checked items using jQuery

Hello,Using Microsoft built-in jquery files, when counting numbers of checked checkbox, the jquery-1.4.2.min.js cannot count the correct result ,however, the version jquery-1.3.2.min.js gives out the correct one, why?            $("#check").click(function () {                var nameSports = new Array();                var i = 0;                $('input[name=selector]:checked').each(function () {                    nameSports[i] = jQuery(this).val();                    i += 1;                });                if (loopCounter != 0) {                    alert(i);                }  

Allow Anonymous Users to respond to blog posts

Hello, I'm using Sharepoint Foundation 2010 and more specifically the blog application. I've turned on Anonymous Access so people can read posts, but I also want them to be able to respond to the posts. Is this possible? Thanks in advance, Bas

Count of number of times the document is downloaded from document library

Hi All, I am working on sharepoint 2007.  My requirement is: I need to take the count of number of times the document is downloaded from document library. I used log report which doesn't solved my purpose. Any Idea how can we acheive this ?   Regards

Blog category view not showing any posts?

Is there something i need to do for the category specific views of posts?I have the categories webpart, and people are adding their posts to 1 or more categories, but when clicking on one of the categories it shows no posts what-so-ever.  THe only posts that do show are ones where I remove all categories.I have tried editing the current view and typing the category name in and that works, I am assuming that the category should be put into that field from the query string by the webpart??? or is there something i need to do??Thx for all help offered.

How to count number of characters in a textbox?

On my current form I have it validating a Canadian Postal Address (xxx xxx). The space is optional but if the user does not use a space, then once the validation passes it will insert one. How can I count the first 3 characters of the textbox, insert a space, then add the rest of the characters?Thank you

count number of files after uploading


Hello, im hope i can make sense to this post cause i dont have an idea where to begin :-) I have some files upload code so the user can upload files to the server (it can be 1 or 5 or 20 files). the code is working fine, and the files uploading to the folder on the server. The problem is, that after the files uploads i need to display to the user some textboxes to every file (like: number of copies, if its color or b/w, the print size etc). is there some way, after the files is uploaded, to show the user the name of the files and for each file name to display some textboxes (like: to count the number of files and then display the names and few same textboxes for each file), thanks

Count the number of users per web page


Hello everyone,

I have a website that has 10 aspx pages in it, and I'm trying to count how many users are on any one page at a time, and display that number on the web page.  I have set it up to use an Application object ("TotalViewers"), and initialize it to 0 in the Application_Start event handler of the global.asax file.  My reasoning (probably way off base) is to increment the count on each page load, and then decrement the count on each page unload.  The increment part works ok, but when I add the code in the page unload event handler to decrement, it seems that Unload happens before the Page is presented to the client, so the  value always stays the same (adds one in page load, subtracts one in page unload).

How else  can I track number of users on each page?  (simply, becuase I am still a beginner).  I have already done some google searching and haven't come up with anything useful. 

All my pages are being navigated via a TreeView control.

Thank you,





Count gives me the same answer regardless of the number of rows


I always get a result of zero from the following code sequence even as the row count changes and I just do not see what the error in my syntax is.




supercount As Integer

supercount = 0


Dim sqlkit As String

sqlkit =

List Item View Count - Blog Site



Is there any way we can find how many times the Article is viewed in a Blog Site.

In Blog Site there is a list called Posts and I have List Items like Article1,Article2, Article3........  Is there anyway i can display the Article View count on the Post.aspx page ? i want display on each article how many times the page is viewed.

Please let me know how to acheive this ..

Thanks in Advance


SharePoint Blog Posts Rating/Voting



It is possible to make a blog and have a voting system for the posts?

Ex: We have a blog and 50 users, everyone posts a joke, and users can vote/rating the jokes. The joke with mosts votes/ratings wins!

Can you tell me if this is possible on SharePoint 2007 and how?


Blog - Changing the URL of user account on posts.

When a post is created on a SharePoint 2010 blog, the title of the post and author is displayed. When clicking on the authors name it brings up the userdisp.aspx with all their info. I need to redirect them to another page that displays the author's bio instead.

Someone told me that I need somehow rewrite the URL inside the div.ms-PostFooter tag. I have absoutely no knowledge of Javascript. Can someone please help??



Count the number of months since start date Options

I have a Measure.TransactionValue and also a Date.Month Dim and a 
Subscriber Dim 

I want to do a Count of months since first transaction date by 

Subscriber | Month | Measure.TransactionValue | 
1 | 201002 | 0 | 0 
1 | 201003 | 100 | 1 
1 | 201004 | 200 | 2 
1 | 201005 | 300 | 3 
1 | 201006 | 0 | 4 
1 | 201007 | 50 5

Make sense?

Any help would be greatly appreciated. 

count number of columns in group



I need to count number of columns in group -

I have a matrix with SUM in the date area.

I have a group column (lats say 'city') and under it my columns (lats say 'street name');

Under each 'street name' I have cell with SUM function.

The problem is:

When The main group (city) is not expand I get the sum of all cities and what I want to get is an average .

So what I thought of was to divide that number in the number of streets under each city group.

How can I get that number?


How do I adjust the # of posts visible on the main page of a blog? Summary view?


So while I love the basic summary view used by the blog, I would like to limit the main page to showing just the 5 most recent updates.  Most views this is easy to edit by adjusting the item limit on the list, but since the Summary view of the posts list doesn't show up anywhere I am unsure where I can set the limit.

I have looked at the editable views in designer but again I do not see the Summary view listed anywnere.  Help


blog posts are shown together


I have a blog hosted in SharePoint (using  the default WSS blog template), I tried to play with the design of the post.aspx page http://geeksconnected.com/jamil/Lists/Posts/Post.aspx, then I decided to reset it to site definition after getting some problems, but when i tried to access my posts like http://geeksconnected.com/jamil/Lists/Posts/Post.aspx?ID=19 (you can try it now!), It didn't list this post for me, instead; it lists the last ten posts as you can see if you try, it seems that the blog site template uses the query string ID=19 to filter posts but now, it is not working. I want it to list a specific post for each link as the default.

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