Friday, May 23, 2008

InformPath Form

To provide users create and edit the survey in the same location in MOSS 2007, one will need to write some code in the page. Here is the details,

First, detach the page from page layout in SharePoint Designer, then check out and edit it.

Second, add the inline code (you will need to modify web.config in order to support inline code)

 

In order to make use of the SharePoint namespace, add the following on top of the page:
<%@ Import Namespace="Microsoft.SharePoint" %>

The code uses a PageViewWebPart and set the ContenLink property according to whether the user has fill out the form or not. If yes, open up the saved xml form. If not, open up a new form.