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 have to open a custom dialog box on click of menuitemtemplate.

I tried:

menuitemtemplate.ClientOnClickNavigateUrl ="javascript:sp.ui.modaldialog.showmodaldialog({url:'http:/sharedev/sitecreate.aspx'width:200px })"

But it shows only as a simple page, not as a popup dialog.

What should I do?

share|improve this question
when you say it shows as a simple page you mean it is basically redirecting the browser to that page ? – Sebastien Stettler Feb 20 '12 at 6:42

JavaScript is case sensitive, and you're also missing a comma in the options. This should work better:

menuitemtemplate.ClientOnClickNavigateUrl ="javascript:SP.UI.ModalDialog.showModalDialog({url:'http:/sharedev/sitecreate.aspx', width:200px });";
share|improve this answer

Use the ClientOnClickScript property instead of ClientOnClickNavigateUrl

share|improve this answer

The best way is to use :

<SharePoint:MenuItemTemplate ID="MenuItem_OpenPopUpPage" runat="server" Sequence="1"
 Text="Open Modal Dialog"
 ClientOnClickScript="OpenPopUpPageWithTitle('/SitePages/Page.aspx', RefreshOnDialogClose, null, null,'PopUp Title')" />
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.