Partager via


Application Development on MOSS 2007 & WSS V3

UPDATED 15-March-2007
UPDATED 16-November-2007 (Option 4 updated with steps)

I have been fortunate enough to have been involved deeply with one of our early Office TAP customer's projects. TAP customers are given access to early builds and betas, along with support from Microsoft, to build a project on. The idea here is that they will be in a position to deploy early on the latest technology and at the same time have a positive impact on Microsoft delivering a quality product to market. TAP customers are key to us taking feedback as we build the product.

In the particular project I am involved with we are building quite an elaborate solution that is built using many of the new features in the 2007 Microsoft Office System. This ranges from the InfoPath embedded in a Win Forms control and on to Microsoft Office SharePoint Server 2007.

Here is a brief list of some of the things we are doing:

  • Building a .Net Win Forms application and embedding InfoPath to do rich offline forms capture in a custom application
  • Custom Visual Studio based Workflows build on Windows Workflow foundation
  • Custom Site Definitions, List Definitions, Timer Jobs deployed as Features via the Solution deployment framework
  • ...

But what I really wanted to concentrate on in this post was talking about what options we considered for building some custom UI that is delivered inside MOSS and the pros and cons of each.

The options we looked at were:

  • Custom built Web Parts
  • A "_layouts" application (see below for what this is)
  • App built using User Controls & Son of SmartPart

The particular component of the application that I want to look at is the UI presentation "engine" i.e. what mechanisms deliver the UI.

Option 1: Custom built Web Parts

With this option you build all your UI using the Web Part framework. Logic etc... can be off in other .Net assemblies or a web service etc... just as you would with any other .Net Application.

Pros:

  • Built using ASP.Net Web Part framework
  • Deployed via Web Part install package or the new Feature/Solution Deployment mechanism
  • SharePoint application provides hosting framework for "putting" these Web Parts on Web Part pages
  • Communications framework for talking with other Web Parts
  • Designed to be highly re-usable across many sites with little effort

Cons:

  • No drag and drop UI for laying out your UI i.e. no design time surface
  • A framework that developers must learn to work within

Summary: A good use of web parts would be where you want to build a widget/mini-application that you can put on many web part pages across many sites.

Option 2: _layouts application

An _layouts application is when you develop an ASP.Net Web Application and deploy it to the c:\program files\common files\microsoft shared\web server extensions\12\template\layouts (what a mouthful!) directory. This is a special directory that gets "virtualized" in each sharepoint site i.e. in each sharepoint site you will have an /_layouts path from the root of the web. E.g. https://servername/sites/sitename/_layouts.

This means you can make your application available under each SharePoint site e.g. https://servername/sites/sitename/_layouts/MyApp/SomePage.aspx

In fact this is how all the SharePoint administration pages are delivered in each site.

Pros:

  • Great way to make your functionality available in every site
  • Easy to develop. It is just like developing a regular ASP.Net web site
  • Context sensitive access to the SharePoint object model. Great for doing work on the site that the user happens to be working in at the time.

Cons:

  • Deployment not managed via Solution deployment mechanism
  • Cant use the ASP.Net master page of the site context as the _layouts application is a separate ASP.Net application

Summary: It is best to use an _layouts based application when you want to extend every site with some functionality such as additional administration pages.

Option 3: User Controls and the Son of SmartPart

The last option is to build your applications UI in ASP.Net User Controls as you would with any other ASP.Net Web Application and then use the Son of SmartPart to deliver those User Controls via a web part.

The Son of SmartPart is a Web Part that is able to "host" an ASP.Net 2.0 User Control :) For more info on this see: https://www.smartpart.info/default.aspx
(if you are wondering who its father is ... that is the SmartPart funnily enough ... and is a Web Part for hosting ASP.Net 1.1 User Controls)

Pros:

  • Simple development experience.
  • You get a design surface to build you UI
  • Deployment reasonably straight forward
  • Can use Web Part connection framework if desired
  • Might be possible to develop these outside of SharePoint first (depending on if they have dependencies to SharePoint).

Cons:

  • Deployment not managed via Solution deployment mechanism Out of the Box (you could build a solution to deploy the Son of Smart Part)
  • Slightly different deployment of User Control files and assemblies (but nothing a .bat file can't fix) during development.

Summary: I think this is a great option when you want to build a rich browser based UI that you only want to use in one (or a couple) of sites. I don't think this is a good option if you want to build a mini-application that you want to include on many sites. A better option in that case might be a Web Part.

Option 4: ASPX pages added to SharePoint Site -- ADDED 15-March-2007 UPDATED 16-November 2007

(Thanks to Michal Gwozdek for emailing me an updated set of steps that work for him)

This option actually was suggested in the comments by a reader.  I thought it was so good i tried it out ... and it works great!  So here it is.

This option allows you to add your ASP.Net application pages into your SharePoint Site.  It also provides for compiling all using the code behind your pages into a DLL.

In a nutshell this option allows you to build your ASP.Net application outside of SharePoint, build it, test it & then add it to SharePoint.  Its great!

Here is how to do it:

1. Install the Visual Studio 2005 Web Application Projects extension.  This gives you the 'old style' web projects in Visual Studio ... so you can compile down to a single DLL etc...

2. START - File - New Project - ASP.NET Web Application - Name it "ItDoesWork"

3. Add reference to Microsoft.Sharepoint

Leave only Microsoft.SharePoint, System, and System.Web

4. In the Solution Explorer create folder "~masterurl" and add masterpage "default.master" inside

5. Replace code behind for the masterpage with:

using System;
using Microsoft.SharePoint;

namespace ItDoesWork._masterurl
{

public partial class _default : System.Web.UI.MasterPage
{

protected void Page_Load(object sender, EventArgs e)
{
}

}

}

6. In the designer, rename ContentPlaceHolder's ID to "PlaceHolderMain"

7. Delete Default.aspx, and add new page - SamplePage.aspx

8. Replace source content with the following:

<%@ Page Language="C#" MasterPageFile="~masterurl/default.master" CodeBehind="SamplePage.aspx.cs" Inherits="ItDoesWork.SamplePage" Title="Untitled Page" meta:webpartpageexpansion="full" meta:progid="SharePoint.WebPartPage.Document" %>

<asp:Content ID="Content5" ContentPlaceHolderID="PlaceHolderMain" runat="server">

Testing Page...

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

</asp:Content>

9. Replace code behind for the page with:

using System;
using Microsoft.SharePoint;

namespace ItDoesWork
{

public partial class SamplePage : System.Web.UI.Page
{

protected void Page_Load(object sender, EventArgs e)
{

Label1.Text = SPContext.Current.Site.Url;

}

}

}

10. Project properties - Build - Output path:

Point it to \BIN folder of our SharePoint Web application. E.g.

C:\Inetpub\wwwroot\wss\VirtualDirectories\moss.litwareinc.com80\bin

You can also manually copy your projects DLL into the \BIN folder each time.

11. Compile your project.

12. Open the web.config file for the SharePoint Web Applicaiton E.g.

C:\Inetpub\wwwroot\wss\VirtualDirectories\moss.litwareinc.com80\web.config

13. Add the following line to the SafeControls section (change to suit your assembly and namespace etc...)

<SafeControl Assembly="ItDoesWork" Namespace="ItDoesWork" TypeName="*" />

14. Change the <trust level="WSS_Minimal" originUrl="" /> line to <trust level="WSS_Medium" originUrl="" />

15. Open your site in SharePoint Designer and drag and drop your SamplePage.aspx page into a folder in your site.

16. Browse to your page E.g.

https://moss.litwareinc.com/TestApp/TestPages.aspx

17. Jackpot! (Hopefully) You should now have your aspx page running in SharePoint.

One of the great things about this option is that you could build your applicaiton outside of SharePoint with any old MasterPage, then deploy to SharePoint and swap out the masterpage string for the correct one.  Thus being able to develop and debug outside of SharePoint and then deploy and test inside SharePoint. 

I can see this option being a favorite for most ASP.Net developers who are used to the integrated/seemless code, build & debug experience.

A note on debugging:  If you want to debug your code once it is running inside SharePoint then all you need to do is attach the Visual Studio debugger to the correct w3wp.exe process (Debug -> Attach to process), set your break points and then hit your page in a browser.

Pros:

  • Simple development experience. Develop outside SharePoint first if desired.
  • You get a design surface to build you UI
  • Deployment reasonably straight forward

Cons:

  • Deployment not managed via Solution deployment mechanism Out of the Box. ( but this might be possible i have not tried it yet)
  • Slightly different deployment of User Control files and assemblies (but nothing a .bat file can't fix) during development.

I really like this option ... coming from an ASP.Net point of view i feel it is a simple option.

 

Decision matrix

Single Site Some Sites Many Sites
Per site functionality Smart Part Smart Part or Web Part Web Part
Single instance application Smart Part or add ASPX pages to site N/A N/A
Site extension functionality Web Part Web Part _Layouts application

In our applications case:

In the project that I mentioned at the beginning of the post the following was true:

  • We wanted to surface application UI in one place in SharePoint
  • There was only ever going to be one instance of the application i.e. surfaced via one SharePoint site
  • Lots of different screens in the UI

Can you guess what option we decided on?

Well, it basically boiled down to either building the UI in Web Parts or using the Smart Part method.

In the end it was built using User Controls and the Smart Part because the developers would be more productive building User Controls (they didn't have any prior SharePoint development experience) and we didn't need to re-use any of the application in multiple sites.

So in the end we ended up with a document library to house Web Part pages for each of the UI "Screens". In each of the web part pages we are using the Son of Smart Part to deliver our User Control that delivers that portion of the application.

I am really keen to hear what other options people are using to develop their applications that are delivered inside SharePoint. Feel free to leave comments ...

-Chris.

Updated:  Changed title to include WSS v3 as Patrick rightly points out this is equally as applicable in WSS v3 also.

Comments

  • Anonymous
    September 04, 2006
    Chris Johnson (Microsoft Consulting Services, New Zealand / TechEd NZ &amp;amp; AU speaker) has written an...
  • Anonymous
    September 05, 2006
    That decision matrix is very handy! Thnx :)
  • Anonymous
    September 05, 2006
    PingBack from http://techtalkpt.wordpress.com/2006/09/06/application-development-on-moss-2007-wss-v3/
  • Anonymous
    September 07, 2006
    Here is an assortment of various 2007 Microsoft Office SharePoint Server Documentation / Reference Materials...
  • Anonymous
    September 10, 2006
    Background:
    Anyone who is familiar with development &amp;amp; deployment of custom solutions on SharePoint...
  • Anonymous
    September 18, 2006
    Chris Johnson posted a great article on the options for conducting UI application development in MOSS...
  • Anonymous
    September 18, 2006
    Sharepoint MOSS WSS 2007 Sviluppo
  • Anonymous
    October 26, 2006
    Chris, It was like a Deja Vu. We went through the same exploration path and chose SmartPart option. Additional advantages were
  • Easy to test. User controls can be individually tested in a non sharepoint environment.
  • Portability - Just in case thing - If we decided to abandon sharepoint then easy to switch to traditional dev/deploy without much of code rewrite.
  • Anonymous
    October 28, 2006
    Chris Johnson (Microsoft Consulting Services, New Zealand / TechEd NZ &amp; AU speaker) has written an

  • Anonymous
    November 09, 2006
    Sharepoint MOSS WSS 2007 Sviluppo Development

  • Anonymous
    December 06, 2006
    Этот пост содержит ссылки на важные материалы, c помощью которых можно качественно повысить уровень знаний

  • Anonymous
    December 19, 2006
    Sous SPS 2003, on résume bien souvent le développement SharePoint à "faire des WebParts". MOSS 2007 change

  • Anonymous
    January 07, 2007
    The matrix is really very helpful. My team and I went through a similar exercise, and decided to go the _layouts route, as our need was to use the custom app in many sites. This matrix will serve to be very re-usable in our upcoming projects :-)

  • Anonymous
    February 04, 2007
    No lo sabia, esta interesante para casos en los que todos los sitios de un sharepoint tienen que usar

  • Anonymous
    February 06, 2007
    Chris, I am evaluating the same options, but for an external internet portal site. Is it possible to use MOSS in a traditional CMS sense, where content and navigation is defined in MOSS, and an external .NET application consumes the sitemap and retrieves content managed field controls using WSS API or Web Services? Of course the external site's structure would need to mirror the site's MOSS structure, and would mirror the master page as well.

  • Anonymous
    February 15, 2007
    The comment has been removed

  • Anonymous
    February 15, 2007
    Adam, You can still just add any ASP.Net code/controls you like direct into web content managed (WCM) pages just like you would in CMS.  My post didnt really point this out ... but i was really talking about adding pages to web part pages etc... rather than WCM ones. Jason, Yes you can get access to all the content via the APIs/Web Services etc... Thanks, Chris.

  • Anonymous
    February 15, 2007
    Hey Chris, Thanks for replying.  Unless I am missing something, I think you may be incorrect about WCM pages.  A WCM page will consist of a combination of a master page, a page layout (.aspx content page that references the master) and a sharepoint "Page", which is basically just an item of data in a sharepoint list. The master pages and page layouts (.aspx pages) are stored in document libraries. If you try to add a code behind file to a master page or a .aspx page layout, or even try to use a server side script block &lt;% %&gt; or &lt;script runat="server"&gt;, you'll get an error from SharePoint that this is not allowed.  While you can drag asp.net controls onto those pages, it doesn't seem like you can write any code behind to interact with them.

  • Anonymous
    February 15, 2007
    Hi Adam, You are right that you have a masterpage, pagelayout & the actual field control content in the "/pages" list.  So what you can do is either wrap up code and layout in a server control for example and use those anywhere you like on the masterpage or pagelayout.  You are right that by default MOSS will not let you put serverside code in a code block ... however you can change this in the web.config file if you want to allow it.  That would allow you to write code to "connect" controls etc... However, I would probably opt for wrapping stuff up in a single control to make things simpler. So ... you can have server controls with code in them and you can add code behind that interacts with them if you make a change to allow that. Hope this helps. Thanks, Chris.

  • Anonymous
    February 27, 2007
    The comment has been removed

  • Anonymous
    March 01, 2007
    http://blogs.msdn.com/cjohnson/archive/2006/09/05/740498.aspx Chris Johnson has a good write up on different

  • Anonymous
    March 01, 2007
    VIA Chris Johnson I have been fortunate enough to have been involved deeply with one of our early Office

  • Anonymous
    March 07, 2007
    In 2003 I created a custom user admin application that sat in the _layouts virtual directory and allowed us to customise the user admin side of things for our team sites. Now we want to be able to do the same thing in MOSS 2007 - only I can't find any way of making it work. According to: http://blogs.msdn.com/cjohnson/archive/2006/09/05/740498.aspx it is possible. Does anyone have any pointers on creating a _layouts Application in MOSS 2007 or preferably is there a how to for doing this? My searches for information have all come up blank... When I tried building a "Web Application Project" with compiled pages and use "publish" to get it to the site (or even just plain old copy), it only works from root. When I try to access from a subsite, SharePoint fails on trying to load the bin.dll.

  • Anonymous
    March 14, 2007
    PingBack from http://www.malcolmgin.com/msblog/?p=89

  • Anonymous
    March 14, 2007
    I had a commenter suggest another fantasic option for integrating an ASP.Net application with SharePoint.

  • Anonymous
    March 20, 2007
    Hi Ted, I hope my reply is not yet late.  I also encountered that error and to resolve it.  I put my aspx page in the layouts folder and then put my dll in the bin folder of my top level site.  You need modify the trust level of the web.config of your TopLevelSite to WSS_Medium if ever you are using SharePoint object Model.

  • Anonymous
    March 20, 2007
    Hi Chris, I tried the steps you mention above in deploying aspx page to sharepoint site. It was working when I only have an event in the page_load but if I have a button with a click_event, the page will encounter an error stating that the event handler 'OnClick" is not allowed in this page.  Do you know whats causing the error and what needs to be done to resolve it. Thanks!

  • Anonymous
    March 21, 2007
    Has anyone figured out how to add an web application as described in option 4 to a Solution package?

  • Anonymous
    March 22, 2007
    Hi I have tried both option number 2 and 4, and I have a problem with not being able to attach to the w3wp.exe process. The breakpoints says "The breakpoint will not currently be hit. No symbols were loaded for this document". I am running my sharepoint site as litwareincok which is member of the administrator group in AD, and is Owner of the Site Collection.

  • Anonymous
    March 22, 2007
    Dear All, Is there any facility to use external webservices without any coding ? If coding is still required, Please let me know the detail steps.

  • Anonymous
    March 23, 2007
    Thank you for describing option 4. I tried it out and it works fine. But I got in trouble with the 'mySite.AllowUnsafeUpdates = true;' statement in my code behind class, throwing a Security Exception. I tried to deploy my dll to GAC (with Strong Name), but this way, the class isn't found any more. Can you give some hints, how this problem could be solved? Thanks Dolf

  • Anonymous
    March 27, 2007
    Following on from my post of application dev on SharePoint ( here ), I have had some people ask how to

  • Anonymous
    March 28, 2007
    Hi Everyone, Jay Arvin:  You need to hook up your event handlers in the code behind.  The autoevent wireup will not work. Ole Kristian:  There might be more than one w3wp.exe process.  Try selecting them all and attaching to all of them. Dolf Steiner:  You might not be reffering to your assembly in the GAC correctly in the web.config file.  Make sure in the safe controls list you are correctly reffering to your assembly with the correct name etc...  SharePoint should have no problem locating assemblies in the GAC as i have deployed web part assemblies this way before and it has worked. Great to see so many people building their apps on top of SharePoint!!!! -Chris.

  • Anonymous
    March 28, 2007
    The comment has been removed

  • Anonymous
    March 31, 2007
    Hi Chris I followed the method of opton 4 to create a custom sharepoint page and deploy into SharePoint site. It works perfectly. But now I encounter a problem with the selectedindexchanged event of a drop-down list in my custom page. Whenver I choose an item in the drop-down list, the drop-down list does trigger a postback event, but the it does not fire the selectedindexchanged event. I have declared the event in page load as below, and yet the selectedindexchanged still does not work. this.dropdownlist1.SelectedIndexChanged += new System.EventHandler(this.dropdownlist1_SelectedIndexChanged); Please advise. Thanks!

  • Anonymous
    April 10, 2007
    I'm trying to run some custom web application projects using option #4.  I'm stuck with trying to get my user controls which are inside my web app project to be registered as safe controls.  They are in the web app dll so they have been signed and deployed to the GAC.  SharePoint doesn't like you to drag the ascx pages into designer and use them in your aspx page, and specifying SafeControl for the MyWebApp with TypeName=* doesn't include the user control evidently. MyWebApp.dll has TestPage.aspx/.cs and TestControl.ascx/.cs Drag TestPage.aspx and TestControl.ascx TestPage.aspx includes an instance of TestControl Run TestPage.aspx I get an error "An error occurred during the processing of /TestPage.aspx. The referenced file '/MyControl.ascx' is not allowed on this page." Any suggestions?

  • Anonymous
    April 10, 2007
    What about Inline code? Please have a look at those articles: http://blogs.vertigo.com/personal/willa/Blog/Lists/Posts/Post.aspx?ID=3 http://www.wssdemo.com/blog/Lists/Posts/Post.aspx?ID=232

  • Anonymous
    April 11, 2007
    I thought web application projects used just in time compilation so there is no dll.  I have installed the Visual Studio 2005 Web Application Projects extension and its pre-requisite and I still dont get a dll ! Otherwise I have to have a minimal .cs file and compile most of the functionality into a C# class project. Have I missed something ? Thanks

  • Anonymous
    April 11, 2007
    Thanks for the gr8 article. I am trying out Option 4 and it seems to work fine. I am having a problem when I use a <WebPartPages:WebPartZone> in the aspx page. I am able to show the page and add webparts to the zone. The problem is when I select Edit Shared Web Part, the edit properties dont show up. Instead I am redirected back to view mode.

  • Anonymous
    April 12, 2007
    Hi, Could any of you who have option 4 working put up a step by step in detail procedur how to do it. I am trying it out but the webpage keeps throwing the error cannot reach the assembly. thanks

  • Anonymous
    April 15, 2007
    option 4 is great! for option 2, you "can use the ASP.Net master page of the site context" as Serge Van Den Oever suggests: http://weblogs.asp.net/soever/archive/2006/11/14/SharePoint-2007_3A00_-using-the-masterpage-from-your-site-in-custom-_5F00_layouts-pages.aspx after following option 4, i have a problem,  my application page located in subsite, and i have modified the site collection's web.config file as option 4, when browsing the application page, it says something: you can't use enablesessionstate in this page. because my application page need CAPTCHA image, which required the session to hold the dynamically generate code.  i am wondering if session state is prohibited in sharepoint? if yes, i have to switch the session mechanism for CAPTCHA to non-session mechanism the difference is i am using application page in subsite,   i am not sure if i need to create a web.config in sharepoint designer under subsite's root directory and modify relating config.

  • Anonymous
    April 17, 2007
    i tried compiling the project you have mentioned in method 4, but it doesn't compile and i receive following errors: Error 1 Validation (ASP.Net): Attribute 'webpartpageexpansion' is not a valid attribute of element 'Page'. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 1 29 WebProject1 Error 2 Validation (ASP.Net): Attribute 'progid' is not a valid attribute of element 'Page'. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 1 62 WebProject1 Error 3 Element 'Content' is not a known element. This can occur if there is a compilation error in the Web site. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 11 10 WebProject1 Error 4 Element 'Label' is not a known element. This can occur if there is a compilation error in the Web site. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 14 6 WebProject1 Error 5 C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx: ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 3 1 WebProject1 Warning 6 Generation of designer file failed: Only Content controls are allowed directly in a content page that contains Content controls. C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx 5 0 WebProject1 Error 7 The name 'Label1' does not exist in the current context C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx.cs 18 13 WebProject1 Error 8 The name 'SPContext' does not exist in the current context C:Documents and SettingsAdministratorMy DocumentsVisual Studio 2005ProjectsWebProject1WebProject1Default.aspx.cs 18 27 WebProject1 can someone help? :(

  • Anonymous
    April 20, 2007
    Great blog, however, I have had tough luck applying the solutions. My task is to put existing and newly created web applications under SharePoint (MOSS 2007). They are supposed to be accessible by some users only. I tried options 3 and 4 and failed: Option 3 (SmartPart). Watched the screen cast, followed the instructions and it fails when adding the SmartPart webpart with "unable to import webpart", or something to that effect. Any ideas? Option 4. Compiler does not like attributes webpartpageexpansion and progid (same as error 1 and 2, Akhlaq). What references are missing? How about standard "Page Viewer Web Part"? Just created a mockup of our new application in VS 2005 and deployed using it. The application contains several screens in several directories, all kinds of controls, forms authentication, etc. Copied the whole thing into the SharePoint directory structure (like in option 2), defined virtual directory, and it works! But there is the concern whether it is fully integrated into SharePoint, the workflows, etc?

  • Anonymous
    April 25, 2007
    Another problem i encountered is after drag the aspx file into a folder in sharepoint Designer, it is browsable using windows authentication, when enabled anonymous access,  the page is inaccessible, not sure how to set the security on the folder for application pages, and is the folder just a folder or Document library?

  • Anonymous
    May 18, 2007
    Hey there.  I'm mega new to anything sharepoint (in any version) , so hopefully this issue is something simple and obvious for those with more sharepoint experience. I followed option 4, created a little hello world page, plopped it on my VM containing Sharepoint, into my site, in a new directory, and conducted all the other steps.  It would work fine except the MasterPageFile token set in the MasterPageFile attribute in this new page is not being processed correctly and is throwing an error saying "The file "/MyNewFolder/~master/default.Master" does not exist.  I have the MasterPageFile attribute set to "~masterurl/default.Master", and based on that message, it makes me think Sharepoint is not processing the MasterPage and asp.net is literally trying to find a file with that name. So, what am I missing here? thanks

  • Anonymous
    May 30, 2007
    In Option 4 I can't compile project. I have the same problems like Akhlaq Khan. I use WSS 3.0 and VS2005 sp1 with all Extensions. Please, help me!

  • Anonymous
    June 14, 2007
    i have another issue do you have any solution for this i want to make a site with new layout outs which have some custome pages(aspx) some list new master page and so one also i need to build it through one click deployment. mean that is there any way to make a pacakage through which i can a installable file which configured my site defination custom pages and dll to the moss existing site or make a new top level site?

  • Anonymous
    June 27, 2007
    The comment has been removed

  • Anonymous
    June 29, 2007
    I figured out the session state problem.  I added a page parser path, seems to fix a lot of the errors I was receiving. http://blogs.msdn.com/kaevans/archive/2007/04/26/code-blocks-are-not-allowed-in-this-file-using-server-side-code-with-sharepoint.aspx <PageParserPaths> <PageParserPath VirtualPath="/pages/test.aspx" CompilationMode="Always" AllowServerSideScript="true" /> </PageParserPaths>

  • Anonymous
    July 03, 2007
    Does anyone know where I can find SmartPart v3?  The GotDotNet site has removed it, and everywhere I look links to the GotDotNet site.

  • Anonymous
    July 03, 2007
    I tried it and this are the results. Whats wrong??? Error 1 Validation (ASP.Net): Attribute 'webpartpageexpansion' is not a valid attribute of element 'Page'. Error 2 Validation (ASP.Net): Attribute 'progid' is not a valid attribute of element 'Page'. Error 3 Could not find 'PlaceHolderMain' in the current master page or pages. Error 4 The name 'Label1' does not exist in the current context Error 5 The name 'SPContext' does not exist in the current context

  • Anonymous
    July 03, 2007
    The comment has been removed

  • Anonymous
    July 19, 2007
    Until yesterday it has been quite a while since I blogged. Basically here is the list of things I have

  • Anonymous
    July 19, 2007
    Until yesterday it has been quite a while since I blogged. Basically here is the list of things I have

  • Anonymous
    July 19, 2007
    Chris ,         Can you provide me Code for protocol Handler in MOSS Thanks

  • Anonymous
    July 22, 2007
    Hi Chris, I tried the steps mentioned above for  integrating ASP.NET pages in MOSS or Share Point 2007. I think that some steps are missing or reference for building the project.Could you please update it with detail steps. Actually i am facing an issue , I have custom .NET application built in 1.1 and I need to move all these functionality to MOSS 2007, will it be wise to convert everything to web part or some sort of navigation to be provided to custom .NET application from Share Pont . Actually these custom .NET application are accessed based on roles and rights that we are gathering while when the user logins authenticating against custom database. Is there any way i could pass session value (like login credentials) of user to Custom .NET application while redirecting from Share Point? It would be nice if you could suggest something. Thanx in advance. Ankit

  • Anonymous
    July 26, 2007
    The comment has been removed

  • Anonymous
    August 02, 2007
    Application Development on MOSS 2007 & WSS V3

  • Anonymous
    August 21, 2007
    "This Page has been modified since you opened it. You must open the page again." This is the message in sharepoint error page. Help.

  • Anonymous
    August 24, 2007
    Is the placing of the page in the directory through sharepoint designer necessary. Can I do it without using the designer?.

  • Anonymous
    August 27, 2007
    Hi, I have tried option 4, which run ok, but now i am having problem connecting to sql server. i can connect to sql server in IIS server. client machine -> IIS server -> sql server. any suggestion. Thanks.

  • Anonymous
    September 12, 2007
    The comment has been removed

  • Anonymous
    September 13, 2007
    Does MOSS have seamless support to VB.Net?

  • Anonymous
    September 17, 2007
    Hi I have tried to attach to our virtual server using VST02005 and I am unable to get the machine to show.  I have been able to map drives to it, and access the url.  I also can not find the machine if I try to browse to it.  Has anyone else had this problem and solved it? Thanks Andy

  • Anonymous
    October 08, 2007
    Hi, Even I tried using VB.NET and it didn't work. The same steps work for C# when I am using Option 4. It is a very clean of integrating legacy web applications, but there is no point to convert them in C# before integrating with Moss. Has anyone successfully tried it?? Thanks, MG

  • Anonymous
    October 10, 2007
    Hi, I integrated dotnet appliation into sharepoint There are some problems i'm not able to solve. Please can i get the solution for the following

  1. In the dotnet application i'm using email sending where email attachment is not working.
  2. When I'm using classes in App_Code folder, site doesn't work Thanks & Regards Madhukaran
  • Anonymous
    October 19, 2007
    Great post.  Two more advantages of option #3 over #4 are 1 )The ability to intermingle your custom stuff with native sharepoint web parts such as document libraries and content editor web parts.
  1. Losing the "building-block" effect of web parts like allowing the administrator to re-arrange the page layout (web part zones) without requiring developer effort.
  • Anonymous
    November 07, 2007
    The comment has been removed

  • Anonymous
    November 08, 2007
    useful links for sharepoint 2007 customization

  • Anonymous
    November 16, 2007
    Hi Everyone, Thanks for all the comments!  It is great to see so many people getting into SharePoint application development. I have just updated the post.  I updated Option 4 with some verified steps sent to me by one of our fellow readers Michal Gwozdek.  These steps work well for him and there are some variations on my original post in there. Thanks a bunch Michal! -Chris.

  • Anonymous
    November 29, 2007
    I tried option 4 and it worked great

  • Anonymous
    December 05, 2007
    I am trying to clean up this website and &amp; and other expressions that let browsers see the site without errors. Is there a reference anywhere for these terms? Specifical the ' and space, .$

  • Anonymous
    December 10, 2007
    Simply awesome! Thanks for the contribution and thought leadership on this subject.

  • Anonymous
    December 14, 2007
    Introduction This is the first in a series of posts on how to build various types of applications on

  • Anonymous
    January 02, 2008
    This may be a little off-topic...but one drawback on the subject of being able to automagically integrate external ASP.NET applications within a SP2007 site is the unfortunate inability to run the external application in its own app pool.  The common workaround is the use of IFRAMES within SP, which of course has many shortcomings.  Option #4 is a sweet solution to the IFRAME problem, only now we have to worry about external applications bringing down the site with poor code that is not directly under our control.  Still, with a proper application integration/code review process, this can be mitigated. I'm curious to hear your thoughts on bringing in multiple (dozen or more) external applications into a single SP portal site via Option #4?  Is gaining the automatic enforcement of the site's master page and access to the SP context worth the risk?   Running an ASP.NET app isolated used to be mandatory in the enterprise, but with SP/ASP.NET 2.0, I'm not sure how much of this is still a concern?  I assume it's as important as ever...or is it? Also, if I've missed the mark, and there is a way to have an external app run with its own app pool via Option #4 (or similar approach), please educate me.  Requirements here being we want automatic master page reuse (without forcing external app to use our master page directly) and access to the portal's SharePoint context (less important). Thanks In Advance!

  • Anonymous
    January 09, 2008
    I'm concerned that MS is not putting enough emphasis on setting up security correctly for a MOSS 2007 infrastructure.  It seems no training classes or documentation clearly defines what permissions are given to Local svr groups, Domain Svr Groups, and to SQL Account Logins to each database created in SharePointMOSS.   For example MS recommends what appears to be 13 seperate accounts to set up a secure Sharepoint Infrastructure- don't beleive me, see http://go.microsoft.com/fwlink/LinkID=92883&clcid=0x409     If your a SharePoint Administrator I've created 2 spread sheets that document the security assigned to each "MS recommended" account at all 3 levels: Local svr groups, Domain Svr Groups, and the SQL Account Logins to each database, HOWEVER, I don't have the expertise yet to finish filling it out.  I can send you a copy up on request. Is there anyone who has used MS's lease security principle when setting up their SharePointMOSSProject 2007 Svr environment?  Who has the knowledge to fill complete the MOSS 2007 security spreadsheet? Mark Mills Mr M Mills1@ Yahoo.com Sr. MS Systems Engineer Houston TX 832-748-1156

  • Anonymous
    February 14, 2008
    I tried option 4 in the above mentioned. I created dll and copied to sharpoint root bin folder. Also copied aspx page to the site where I need. I receive error message saying "An unexpected error has occurred". I can not debug. Because I do not see w3wp.exe process. Any one please help me to fix this. Thanks in advance, GR

  • Anonymous
    February 15, 2008
    I tried in VB the option 4. This is exactly what I need. Great!. But It doesn't work, the same as mentioned in step4, no changes at all except in VB. Any body having any suggestions please?

  • Anonymous
    February 24, 2008
    Thanks for sharing your thoughts. Its really a nice post!

  • Anonymous
    March 24, 2008
    For those having trouble with option 4; I had to give it a strong name and add it to the GAC

  • Anonymous
    March 25, 2008
    I have data in a SQL table. I want to display this data on a sharepoint site in such a way that data can be modified in the table, through the site (use the site to add data or modify existing data). after loads of readig and research, i only seem to get to know that it is not possible. is it true that Sharepoint sites cannot be connected to SQL dbs or tables directly. Any change in the table is not directly reflected on the site. TO display data from a table on the site, i used BDCMetaMan to get an XML of the table and add that to the application as BDC. Is there any other better way of doig this?

  • Anonymous
    March 25, 2008
    Hi nimi, You should investigate the DataForm web part.  It will allow you to do what you are looking for. Check out the "Build composite no-code SharePoint applications" video here: http://office.microsoft.com/en-us/sharepointdesigner/HA102199841033.aspx?pid=CH102201271033 -Chris.

  • Anonymous
    April 01, 2008
    I have created a webpart that loads multiple usercontrols I place them and reference them from /_controlTemplates/MyDir this works fine. The webpart loads and i have full control. The thing i dont understand is this... I have two projects the webpart itself and a VS2005 "Web Application" that encapuslates all my usercontrols inside a single DLL. My on build events place the usercontrols inside the above mentioned dir on the server. I register my single dll as a safe control and my webpart works perfectly. However, I get an error in the event viewer saying "Error intializing Safe Control" I can not figure why I keep getting this eror r. Once again, aside from the error the webpart works great.

  • Anonymous
    May 15, 2008
    Hi everybody, I am developing one business application using MOSS. I am having two options for storing business data:

  1. MOSS custom list
  2. SQL server 2005 tables If I use MOSS custom list,it will break data integrity of business data tables as I can not use Primary key and foreign key relationship on custom list. If I use SQL server 2005 tables for storing business data,I can not use in build MOSS functionality like Work flows,custom list etc. Is there any other better way of doig this? Thanks in advance.
  • Anonymous
    May 15, 2008
    Hi everybody, I am developing one business application using MOSS. I am having two options for storing business data:
  1. MOSS custom list
  2. SQL server 2005 tables If I use MOSS custom list,it will break data integrity of business data tables as I can not use Primary key and foreign key relationship on custom list. If I use SQL server 2005 tables for storing business data,I can not use in build MOSS functionality like Work flows,custom list etc. Is there any other better way of doig this? Thanks in advance.
  • Anonymous
    May 15, 2008
  1. Open your site in SharePoint Designer and drag and drop your SamplePage.aspx page into a folder in your site. This means i need to  open web application that is in iis virtual diractory, and there i have to create one folder as we want , and placce the pages developed in asp.net. please correct me . i am new in sharepoint development. thanks
  • Anonymous
    May 22, 2008
    I am trying to use method 4. To get past ERROR #1 (see below), I had to copy the ~masterurl folder to the application folder on the server (...81binItDoesWork). In step 4 of option 4 (create "~masterurl" folder), am I correct that the folder should be created within my project folder (ItDoesWork)? I am using VS2008. Do I need to copy the default.master to somewhere else on the server, and if so, where on the server? ERROR #1: Parser Error Message: The file '/itdoeswork/~masterurl/default.master' does not exist.

  • Anonymous
    May 22, 2008
    The comment has been removed

  • Anonymous
    May 22, 2008
    The comment has been removed

  • Anonymous
    June 06, 2008
    I want to use AJAX in a user control deploy it in a site page using son of smart part, place the scriptmanaget in PlaceholderMain of the page. But I am getting an error "Only one instance of a ScriptManager can be added to the page.". Can anyone help me how to resolve this?

  • Anonymous
    July 16, 2008
    I'm also getting the error message : The file '/itdoeswork/~masterurl/default.master' does not exist. I don't have SharePoint Designer installed in my computer so I copied the page .aspx to the share point application (I didn't add the master page or the code behind page) I would appreciate if you could help me figure out what I'm doing wrong. ureyes84 at gmail dot com

  • Anonymous
    September 12, 2008
    If you get an "error occurred, contact the admin" message, you want to check if there if <form> element in the aspx page. Eliminate the <form> element as it is getting duplicated when it is ported to MOSS. For a detail step by step walkthrough, check out http://www.firozozman.com/Whitepapers.html

  • Anonymous
    November 30, 2008
    The comment has been removed

  • Anonymous
    January 19, 2009
    遇到过想删除掉这个MasterPage会出现这个错误: Thisitemcannotbedeletedbecauseitisstillreferencedbyotherpag...

  • Anonymous
    January 23, 2009
    Chris I used option 4 to develop/copy samplepage.aspx into the page library of a publishing sub site below the site collection top site.   Using right click "Preview in Browser" in SPD, the page works.  It continues to work as long as I navigate within the site.   However, if I go to the top level site and navigate back to my sub site, the samplepage fails to load with the following error - "An error occurred during the processing of . Could not load type 'ItDoesWork.SamplePage'." Any ideas? Thx Fred

  • Anonymous
    January 25, 2009
    Chris Please disregard my previous "I used option 4 to develop/copy samplepage.aspx ...".   I have two wfe servers in my new development environment, and neglected to copy the dll to the bin of the second server.  Everything was fine if I accessed and stayed on the first server, but the page failed when NLB sent me to the other server. D'oh Fred

  • Anonymous
    January 29, 2009
    Pardon my ignorance on this maybe I am missing the point completely but wouldnt it be easier to deploy your custom pages by programmatically adding them to the pages splist? I basically, had a simple .aspx page with a user control. I deployed it via this method.

  • Anonymous
    March 20, 2009
    Hi Chris, I am a sharepoint Newbie and had been really struggling to get to grips with code behind files in Sharepoint (or lack of). Your step by step guide was perfect. However, I was wondering if there is anyway you could do something in the same format for implementing code behind in masterpages (preferably in VB). I have been trying to follow Andrew Connell's guide on MSDN but there are evidently gaps in my knowledge that are exposed by his explanation as it just seems to trail off to leave me in confusion. Any help you can give on this is much appreciated. Thanks

  • Anonymous
    April 30, 2009
    Hi Chris, I was able to develop a custom application for my Share Point site using Option 4. Just one question here. I need to read some configuration values (user defined) from web.config from the appsettings section. So in the Option 4, do I need to insert the appsettings element (with key and value) in the web.config of the virtual dir for that site? Is there any better option? Also how can I use session variables? I need to pass a complex object from one page to the next... Thanks.

  • Anonymous
    May 01, 2009
    People trying option #4: You have to create the project in C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTS. If you create a project called Test then it will go to C:Program FilesCommon FilesMicrosoft Sharedweb server extensions12TEMPLATELAYOUTSTest To view it in share point just http://localhost/[Any Site Name You Want]/_layouts/Test/default.aspx You may have to remove the authentication=windows in this apps web.config

  • Anonymous
    May 05, 2009
    Hi! very nice post. Im currently trying to figure out how I can publish existing ASP.net applications to a newly built WSS server. This post really helped me to know what to look for! Thank you. Alex

  • Anonymous
    June 23, 2009
    The comment has been removed

  • Anonymous
    July 07, 2009
    Zach, puting it into the Layouts folder is part of an entirely different solution.  The Layouts folder is virtualized across all sites, and is not ideal for some situations. #4 is a way to have a single instance of an application. The grid in the original posts illustrates this.

  • Anonymous
    August 06, 2009
    Error:  The Master Page file ‘~masterurl/default.master’ cannot be loaded.  Correct the problem in Code View I was receiving the above error when trying to “edit” my SamplePage.aspx from example 4 with the VS 2008 “design mode” tools.  It worked fine when deploying to SharePoint as described in the article. This is because the ~masterurl code in SamplePage.aspx and the ~masterurl folder name, refers to a “virtual server” location, not the actual “file structure” location. So, for using the VS tools in Design mode, you need to change the ~masterurl to just masterurl (notice the tilde is gone) in both the SamplePage.asxp and the folder name.  Then, you can use the “Design” mode within VS to layout your page/add controls, etc. When you deploy to SharePoint, just switch these items back. Hope this helps. Aaron Wiggans

  • Anonymous
    December 14, 2009
    Decision matrix help me to choose the correct option. It's very nice post. In my case i am using option 4.

  • Anonymous
    March 07, 2010
    Hi, here is a tutorial for adding custom codebehind to sharepoint aspx page, especially masterpage. if you want, take a look on it http://sharepoint-charles.blogspot.com - <a href="http://sharepoint-charles.blogspot.com">Masterpage with codebehind</a>

  • Anonymous
    May 12, 2010
    Option 4 was brilliant! Thanks to you and Michal Gwozdek for this. I wonder if an asp.net app can run inside MOSS but built and deployed using WSPBuilder.