Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

SP.UI.ModalDialog.showModalDialog closes parent window

$
0
0

Hi

I've got a visual web part that hosted inside a web parts page in SharePoint 2010. It shows the /_layouts/PickerTreeView.asp page as a modal. However, if I select an item from the PickerTreeView.asp page and press OK. It tries to close itself and the parent window. Does anyone what would be causing this? Below is the code for the visual web part.

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %><%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %><%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1UserControl.ascx.cs" Inherits="ImporterExporter.VisualWebPart1.VisualWebPart1UserControl" %><script type="text/javascript">
    function OpenDialog() {
        var opt = {
            url: '/_layouts/PickerTreeView.aspx'


        };
  SP.UI.ModalDialog.showModalDialog(opt);
  return false;

    }
</script><input type="button" onclick="OpenDialog()" />

Thanks


Viewing all articles
Browse latest Browse all 11508

Trending Articles