Michael's profileMichael's Coding DenBlogListsSkyDrive Tools Help

Blog


    July 09

    Moving ASP.NET master.page to SharePoint

    In these days SharePoint become more and more popular. There are number of web project which starts directly in SharePoint, but however a lot of project remains out the SharePoint scope, and exists as pure ASP.NET application.

    The one of the common task of migrating ASP.NET application to SharePoint is changing the site landing page to become SharePoint page. But it’s where the problem starts. ASP.NET applications tend to consume different modern tools and technologies like ASP.NET MVC, SilverLight, URL Rewriting and others which seems to be very common in pure ASP.NET development, but could be the potential problems in SharePoint world.

    There are three thing you need to concentrate on

    1) master.page

    • Remove AutoEventWireup="true" attribute. SharePoint doesn’t support it on all pages;
    • User controls are not supported on master.page, so move them to CONTROLTEMPLATES folder and change references
    • Check that all classes you inherit from has the namespaces

    2) CSS

    • SharePoint doesn’t support CSS validation on 100%, so I can hardly recommend something specific here. But what did helped me a lot id debuging and CSS customization is just to have the “clean” CSS file, which resets all customization http://meyerweb.com/eric/tools/css/reset/

    3) Web.config

    • You need to make sure that you are using the right siteMap defaultProvider (<siteMap section>) from your ASP.NET web.config, otherwise all your SiteMap elements will be considered as Sharepoint Publishing classes elements (if u have MOSS), which are differs from asp.net SiteMap classes
    • If you are using URL rewriting or other specific modules you need to create the <system.webServer> section in SharePoint config file and add them there.
    • You need to add all your DLLS to the list of SafeControls

    4) Code

    • You need to have [assembly: AllowPartiallyTrustedCallers()] in your dlls.
    • DLLs must be signed
    • All classes must have namespaces

     

    Mirror: http://msmvps.com/blogs/laflour/archive/2008/07/10/moving-asp-net-master-page-to-sharepoint.aspx

    Comments (4)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Picture of Anonymous
    (名前なし) wrote:
    Nov. 7
    Oct. 28
    I can't say that there are any advantages of *changing* web project from asp.net to sharepoint.
    This is pretty rare situation and could happen in the next cases
    1) Web designers created web site didn't have sharepoint knowledge and now you need convert it to sharepoint site
    2) You already have internal sharepoint site for document management (for example) and separated web-site to advertise your business, but once you decided to integrate your sharepoint into existed web site.
    Well.. all this cases include a lot of changes and customization as in asp.net site and in sharepoint as well.
    July 24
    You didn't mention the advantage of changing to SharePoint and I'm genuinely wondering what it would be. Could you add that?
     
                        The Castle Lady      Thanks !
    July 22

    Trackbacks

    The trackback URL for this entry is:
    http://laflour.spaces.live.com/blog/cns!7575E2FFC19135B4!1124.trak
    Weblogs that reference this entry
    • None