Customising Blog

Topics: Controls
Aug 29, 2007 at 7:39 AM
I have been working on blogEngine.net in my existing website and now i have successfully integrated it in my website.

I would like to thank BlogEngine.net team for making such a wonderful bloggging platform.

Now i want to have paging in authors list as i have large no. of authors. Can some one please send me any sample code or technique to page authors as post paging.

Thanks in advance
Aug 29, 2007 at 2:32 PM
Het Chetna, everyone says thank you.

I understand that you have a large number of authors. Are you wanting to have "paging" as in a datagrid with << < > >> in the datagrid's page footer?

If so, you can create your own class called something like "AuthorListPaging.cs".
You will have it render a datagrid with all of your settings. You will bind it to the property of Post.Posts.
Use the AuthorList.cs for some ideas on how to get the feeds into the control.

That should get you started.

Chetana wrote:
I have been working on blogEngine.net in my existing website and now i have successfully integrated it in my website.

I would like to thank BlogEngine.net team for making such a wonderful bloggging platform.

Now i want to have paging in authors list as i have large no. of authors. Can some one please send me any sample code or technique to page authors as post paging.

Thanks in advance

Aug 30, 2007 at 5:25 AM
First of all, Thanx for the quick response.

But i m not getting how to render Gridview in class file. So can u please send me few line of code or example to do so.

Thanx in advance.
Aug 30, 2007 at 11:42 PM
There are two ways to do this. I suggest that you create a pagedauthors.ascx. Add the reference to your themed page.

<%@ Register Src="~/User controls/pagedauthors.ascx" TagName="PagedAuthors" TagPrefix="chetana" %>
(Use a little vanity ;)

In the page load event of the pagedauthors.ascx set the binding datasource of the gridview to Membership.GetAllUsers();

pagedauthors.ascx ------------ CodeBehind file------------------
protected void Page_Load(object sender, EventArgs e)
{
GridView1.DataSource = Membership.GetAllUsers();
}

pagedauthors.ascx ------------ Actual ascx file------------------
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PagedAuthors.ascx.cs" Inherits="UsercontrolsPagedAuthorsascx" %>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns=false>
<Columns>
<asp:BoundField DataField="UserName" />
</Columns>
</asp:GridView>


You have to configure the rest of the gridview.





Chetana wrote:
First of all, Thanx for the quick response.

But i m not getting how to render Gridview in class file. So can u please send me few line of code or example to do so.

Thanx in advance.