Sharep10nt

All About SharePoint 2010/2013

  Home  |   Contact  |   Syndication    |   Login
  23 Posts | 0 Stories | 0 Trackbacks

News

Exploring SharePoint 2013 Online

Developing Nintex Workflows

Exploring SharePoint 2013

Acquired MCPD : SharePoint 2010 Developer

Share on Facebook

Article Categories

Archives

Post Categories

A page which opened within dialog framework can pass some values(actualy single value) to parent page(Page which invokes dialog). Assume I have registration page which opened within Dialog. If Registration success then I have to pass a value otherwise different value to parent page. It's possible to pass single value with

commonModalDialogClose(ReturnParameter,Target);

Once the registration completed successfuly then I want to show some message in the dialog itself and autoclose after few seconds. Here the code which I invoke on RegistrationButtonSubmit.

if(boolIsRegistrationSuccess == true)
{
lblResult.Text = 
"<span class='ms-rteElement-H2'><img src='/_layouts/images/kpinormal-0.gif' width='16' height='16' alt='Completed' align='absmiddle' hspace='5'/> You've been registered to our site Successfully.</span>";
lblResult.Text = "<script type='text/javascript'>var intTimerCount = 0; function funCloseWindow() { if(intTimerCount == 20) {try{window.frameElement.commonModalDialogClose(1, 1);}catch(Err){}} else { intTimerCount++; setTimeout('funCloseWindow()',200);} } funCloseWindow();</script>";
}

Now this dialog page show the message and closes itself automatically within few seconds. Here am passing parameters (1,1) to parent page Javascript method function CloseCallback(strReturnValue, target).

strReturnValue can be checked inside javascript and do actions if any.
posted on Thursday, November 18, 2010 9:24 AM

Feedback

# re: How to close and pass values from Dialog Framework within a page? 8/26/2012 10:46 AM dotNetFollower
Hello!
Nice article. But nothing was said about passing parameters into the page opened in dialog. So couple of words about that is here - SharePoint: How to pass parameters into a Modal Dialog Window and then access them.

# re: How to close and pass values from Dialog Framework within a page? 2/12/2014 9:49 AM kris
This is a timely information to me, I can use this in my project. - Kris Krohn


comments powered by Disqus