Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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
add comment

3 Answers 3

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
add comment

Use the ClientOnClickScript property instead of ClientOnClickNavigateUrl

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.