Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a list in Visual Studio 2010 with a custom forms (EditForm/NewForm). I deploy the project to SharePoint Server 2010, to update the New Item form.

The problem is that if I deploy the project then the list is updated and all the items are deleted. But I only want to update the New Item form (an application page).

share|improve this question

3 Answers 3

If you have a content type for your list, you can update DisplayFormUrl, NewFormUrl and EditFormUrl:

var list = GetList();
var contentTypeId = GetContentTypeId();
var contentType = list.ContentTypes[contentTypeId];
contentType.NewFormUrl = "http://<servername>/newFormUrl.aspx";
share|improve this answer

I suppose you can move your aspx page used as form to separate feature or even a separate project (and separate WSP packet) - then you will be able to update this form alone.

share|improve this answer

You can simply copy-paste your page (.aspx) to server template folder (typically located here C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14; where 14 - it's SharePoint 2010, 15 - SharePoint 2013) and execute iisreset.

If you've updated your code behind class: compile it and execute a gacutil command:

gacutil /i YourLibrary.dll

Also, you need execute an iisreset.

Hope, it's helpful for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.