SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the SP.UI.ModalDialog to popup a custom form. The form uses an XSL stylesheet that uses the GenFireServerEvent to commit the data. This works correctly, but I want to close the popup once the data is saved. What do I need to do to modify this form to commit the data and close the dialog?

share|improve this question
up vote 4 down vote accepted

I am adding this so that others who stumble accross it might find it useful. I got this to work by adding a __redirect to the GenFireServerEvent like this: onclick="javascript: {ddwrt:GenFireServerEvent('__commit;__redirect={WhateverPage.aspx?IsDlg=5'})"

Then on this page add something like this:


function closeme() {
    if (tp1.indexOf("IsDlg=5") > 0) { window.frameElement.commitPopup(); }

This is what I needed to make this work!

share|improve this answer
above solution not working for me. can you please suggest me other solution – Rahul Dayal May 2 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.