Let say we have a publishing page, and we create a link on that publishing page to the NewForm of a List.
Aftre the user created the listitem we would like to go back to the page the user clicked the link, in stead of the list overview page.
When you want to return to the page you came from, sharepoint uses a QueryString Parameter called "source".
Microsoft was even kind enough to provide us with al small javascript function to automatically add this parameter to a Link.
In a content editor webpart u can use
<A onclick="GoToLink(this);return false;" href="/feedback/_layouts/listform.aspx?PageType=8&ListId={B0EF9608-FC48-401E-9343-4EDDF4585131}&RootFolder=">new feedback</A>
--update--
If however you are in a Publishing page Content Field, SharePoint is kind enough to strip all javascript from the contents.
So you will have to manually add the source parameter for that link.
GoToLink is located in the core.js
9de28790-d692-4abd-b2de-9924fe4e2f91|1|2.0
Found out today that the behaviour of the PublishingWebControls:EditModePanel changed between MOSS2007 and SP2010.
Apparently,now in SP2010, you need the EditItem Permission to be able to see what is in an EditModePanel even if the PageDisplayMode attribute is set to "Display".
So basically it works like a SPSecurityTrimmedControl
Example:
<SharePoint:SPSecurityTrimmedControl PermissionsString="EditListItems" runat="server">
</SharePoint:SPSecurityTrimmedControl>
Update
This behaviour has been changed back to 2007 behaviour as of SP1 for Sharepoint 2010
5603cb67-ffb1-44da-a61d-6f89b92c480c|0|.0