views:

71

answers:

1

In a Windows app we have a link to create a document in our Sharepoint Wiki (socially created help system)

http://maxnet/IT/Development/_layouts/CreateWebPage.aspx?List={9d81229a%2D29f5%2D4dc1%2D80f8%2Deb10c55b906b}&RootFolderUrl=Help%20Wiki&Name=HowToPrint

Calling this page several time, even after the Wiki doc was created still gives a blank edit page. It's not until the user attempts to save that they are informed the Wiki entry exists already.

Can I change the single URL so that if the Wiki exists, it opens in edit mode, if not, it opens in create-new mode?

This way the apps that link to the Wiki can have links that don't need to change.

+1  A: 

As CreateWebPage.aspx is owned by SharePoint and it is not recommended to do any modification to it. Also there is no other parameter you could tweak to check if the page exists or not by default. Considering above two limitations ,There are only two option you can follow to get this done.

  1. In your windows Application check to see if the Page Exist, Simple WebRequest can be issued to the SharePoint with the URL and if it returns 404 then, redirect to the New Page else the existing page.
  2. Make a copy of the CreateWebPage.aspx, call it CustomCreateWebpage.aspx & make changes to it, to check if the page with the Name already exist if so redirect that in edit more else, new page. From your Windows Application redirect to the CustomCreateWebPage.aspx instead of CreateWebPage.aspx
Kusek