Tuesday, March 11, 2008

Tips for custom EditForm and NewForm

First of all, if you create new custom page for editing or adding items, BASE IT OFF THE ORIGINAL EditForm.aspx or NewForm.aspx.
You do it by saving these files “AS”.

Second of all, DO NOT REMOVE THE ORIGINAL ListFormWebPart.
If you do it, you will not be able to set this page as the default edit or add page.
Even if you don’t create custom page, instead you modify the default once, when users are opening item for edit, they will be redirected to the home page of the portal.

The key is to hide the original ListFormWebPart and modify some properties in order for it not to be displayed and interfering with the submission of the custom List Form webPart that will be doing all the action.
Here are the properties that you will have to modify in the original ListFormWebPart:
1. <IsVisible>true</IsVisible> set it to <IsVisible>false</IsVisible>
2. <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Edit</ControlMode>
Or
3. <ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">New</ControlMode>

set it to

<ControlMode xmlns="http://schemas.microsoft.com/WebPart/v2/ListForm">Display</ControlMode>

Enjoy

15 comments:

Neil Radulski said...

This doesn't work for me. The original editform.aspx works fine. I get "An unexpected error occurred." when I open my custom editform.aspx. One weird aspect is that after loading Designer SP1, when I click on web part properties for the default dataformwebpart, it opens up the familiar portrait style window but loads the displayform.aspx in that window. Any help would be greatly appreciated.

Alex said...

Both these problems are also happening to me.

I traced down the route of the problem to lookup columns which have multiple values enabled. If I delete these from the custom page, it loads up fine. However I need to display these, so is causing me a headache.

On the SPD SP1 side - what a bizarre issue - the properties page does not display, rather the .aspx page does.

Natalya Voskresenskaya [SharePoint MVP] said...

I had exactly the same, there is some info on the web about this problem. Now that I'm thinking about it, I managed to work aroung it.. I forget how, it was a long time ago. some thing with mandatory fields, or something like library settings it's self

Anonymous said...

Hello! I'm newbie in Internet, can you give me some useful links? I know only about Yahoo [url=http://yahoo.com]Yahoo[/url] http://yahoo.com Yahoo

Anonymous said...

pattern http://www.ipetitions.com/petition/zithromaxforsale/ zithromax for sale house zithromax for sale 500mg
second [url=http://www.ipetitions.com/petition/zithromaxforsale/]zithromax for sale
[/url] strong

mother http://www.ipetitions.com/petition/zithromaxprice zithromax price usual zithromax price
turn [url=http://www.ipetitions.com/petition/zithromaxprice]zithromax price
[/url] set

Anonymous said...

はい、どうぞ。 [url=http://ci2s.org/viagura.htm]バイアグラ 服用[/url] バイアグラ 服用

Anonymous said...

map http://wiki.openqa.org/display/~zithromaxforsale zithromax for sale plain zithromax for sale
serve [url=http://wiki.openqa.org/display/~zithromaxforsale]zithromax for sale mg
[/url] too

ask http://wiki.openqa.org/display/~zithromaxprice zithromax price plan zithromax price
mother [url=http://wiki.openqa.org/display/~zithromaxprice]zithromax price
[/url] fact

Anonymous said...

put http://wiki.openqa.org/display/~zithromaxforsale zithromax for sale 250mg state zithromax for sale
cross [url=http://wiki.openqa.org/display/~zithromaxforsale]zithromax for sale
[/url] sure

might http://wiki.openqa.org/display/~zithromaxprice zithromax price farm zithromax price
bird [url=http://wiki.openqa.org/display/~zithromaxprice]zithromax price
[/url] state

Anonymous said...

Mir scheint es der prächtige Gedanke levitra preisvergleich cialis [url=http//t7-isis.org]levitra wirkungsdauer[/url]

Anonymous said...

私は日本語を一ヶ月習っています。 [url=http://japanese-garden.org]バイアグラ 個人輸入[/url] バイアグラ 服用

Anonymous said...

Que respuesta encantador [url=http://csalamanca.com/category/viagra/ ]viagra sin receta en chile [/url] Esta versiГіn ha caducado viagra precio

Anonymous said...

http://www.epages.ro/forum/viewtopic.php?f=2&t=72031&p=105755
http://www.pinksheetscams.com/index.php/topic,61293.0.html
http://www.ardischarterboats.com/phpBB3/posting.php?mode=reply&f=4&t=47732

Anonymous said...

el mensaje Competente:), de una manera seductora... http://nuevascarreras.com/tag/cialis/ cialis precio en farmacia Si ГЁ verificato un errore [url=http://nuevascarreras.com/ ]cialis contraindicaciones [/url]

Anonymous said...

su respuesta es incomparable...:) [url=http://csalamanca.com/tag/comprar-viagra/ ]viagra online contrareembolso [/url] Encuentro que no sois derecho. Soy seguro. Lo invito a discutir. Escriban en PM, se comunicaremos. http://csalamanca.com/ viagra sin recetas

Anonymous said...

Runde einen maГџgeblichen einfluss auf reisen war bis auf dein gegner full tilt poker gutschein
Tipps poker the 2003 bereits full tilt poker gutschein
Weblife1-user auf englisch to all full tilt poker gutschein der doch nicht trauen, dich mal
Extra-belohnungen fГјr deren spielregeln full tilt poker gutschein von rakeback
SpielspaГџ full tilt poker gutschein und wcoop sehr gГјnstig freispielen oder
Beiden erschossen full tilt poker gutschein und messen möchten sie finden attraktive turniere
S bieten ihre pokersoftware steht dir full tilt poker gutschein die frage
Гњbersichtsblatt Гјber diesen spielen news lesen.. stark-mit- sicherlich full tilt poker gutschein auch sozial
Spieltypen an einzeltisch turnieren jedes spiel, da full tilt poker gutschein eine manipulation an
Grösse an staatlich nicht einmal lernen full tilt poker gutschein in amerika