SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

Can we display a custom web part (developed in visual studio 2010) in a modal dialog pop-up? If yes then how can we do that... any tutorials or article?


share|improve this question
As per below posters, yes you can. A WEbPart is nothing more than a ASCX (Server control). Put the custom web part on a page somewhere and open that page using the SharePont ModalDialog Object. – Fox Sep 10 '13 at 8:04
up vote 1 down vote accepted

You can show any page using eg SP.UI.ModalDialog. You could just add your WebPart to a page, and link to it:

<a title="aTitle" onclick="javascript:SP.UI.ModalDialog.ShowPopupDialog('http://link/to/page/with/webpart.aspx');return false;">
share|improve this answer
Hey, that shouldn't be necessary. SP.UI.Dialog.$1h add ?IsDlg=1 , in fact it will add another if you have one in your url. Like this: ?IsDlg=1&IsDlg=1 – Anders Aune Oct 7 '14 at 8:10
Ah, true, ?IsDlg=1 is not needed in the URL. – Jussi Palo Oct 7 '14 at 8:18

Yes. You can place web part in any page and show this page in dialog. How to call dialog: MSDN: SP.UI.ModalDialog.showModalDialog(options) Method

share|improve this answer
<script type=”text/javascript”>
 function OpenDialog(URL) {
  var options = SP.UI.$create_DialogOptions();
  options.url = URL;
  options.width = 600;
  options.height = 400;
share|improve this answer

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.