2
votes

I have my custom ribbons deployed with the feature on to each document library on SharePoint server. On ribbon button click modal window is shown with my custom page. In some cases I would like to redirect user back to document library (not close modal window but redirect), to document library settings page or Secure Store Services credentials page. Currently when redirect is done new page is opened in the same modal window. I would like to to redirect to the actual page without modal window. Could you please help me with this? Is there some API for doing such kind of redirect in SharePoint 2010?

Thanks beforehand,
-Petro

1

1 Answers

5
votes

Consider situation: you are on the Documents Page and on this page modal dialog "Custom Document Action" is opened:

To close modal dialog "Custom Document Action" and redirect to other page register startup script to the page

 String script = String.Format("window.frameElement.navigateParent('{0}');",   SPHttpUtility.EcmaScriptStringLiteralEncode(urlToOtherPage));
 page.ClientScript.RegisterStartupScript(page.GetType(), "redirectToPage", script, true);