Showing posts with label Url. Show all posts
Showing posts with label Url. Show all posts

Wednesday, March 23, 2011

make friendly URL’s for your SharePoint 2010 site in 4 steps with IIS7 URL Rewrite module

I started developing an Internet facing site with the help of this book : http://www.amazon.com/Professional-SharePoint-Branding-Interface-Programmer/dp/0470584645/ref=sr_1_12?s=books&ie=UTF8&qid=1300888674&sr=1-12#_

However, for me SEO is critical nowadays and this book did not give me any information on how to make my Share Point 2010 Internet facing site URL friendly. Because I'm an ASP.NET developer, I knew that now we have the URL Rewrite module in IIS7 and I wondered if I could apply it to a Share Point site as well.

I found this great post that explains how to achieve Share Point 2010 friendly URL by using the II7 URL Rewrite module.

http://blog.mastykarz.nl/friendly-urls-sharepoint-site-4-steps-iis7-url-rewrite-module/

After following the steps stated in the above link, I was able to produce a friendly URL.

Monday, February 28, 2011

Creating a simple Pager user control with ASP.NET and C#

The following is a simple user control that will display a Pager functionality for any type of web page that deals with large amount of data that need to be segmented in pages.

This is part of a larger project and perhaps in the future I will present the finished project, but for now this user control can help us organize our data with a data list.

  1. Create a new web site project in Visual Studio
  2. Add a new Web User control named Pager.
  3. In Source View (Asp.Net) write the following code
  4. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Pager.ascx.cs" Inherits="UserControls_Pager" %>
    <p>
    Page
    <asp:Label ID="currentPageLabel" runat="server" />
    of
    <asp:Label ID="howManyPagesLabel" runat="server" />

    <asp:HyperLink ID="previousLink" runat="server">Previous</asp:HyperLink>

    <asp:Repeater ID="pagesRepeater" runat="server">
        <ItemTemplate>
            <asp:HyperLink ID="hyperlink" runat="server" Text='<%#Eval("Page") %>' NavigateUrl='<%#Eval("Url") %>' />
        </ItemTemplate>
    </asp:Repeater>
    <asp:HyperLink ID="nextLink" runat="server">Next</asp:HyperLink>
    </p>