Invoke page (NewList)
<%@ Assembly name= "$SharePoint. project.assemblyfullname$"%>
<%@ Assembly name= "Microsoft.Web.CommandUI, version=15.0.0.0, culture=neutral, publickeytoken=71e9bce111e9429c"% >
<%@ Register tagprefix= "SharePoint" namespace= "Microsoft.SharePoint.WebControls" assembly= "Microsoft.SharePoint , version=15.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c "%>
<%@ Register tagprefix= "Utilities" namespace= "Microsoft.SharePoint.Utilities" assembly= "Microsoft.SharePoint, version=15.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c "%>
<%@ Register tagprefix= "asp" namespace= "System.Web.UI" assembly= "System.Web.Extensions, version=4.0.0.0, culture= Neutral, publickeytoken=31bf3856ad364e35 "%>
<%@ Import namespace= "Microsoft.SharePoint"%>
<%@ Register tagprefix= "WebPartPages" namespace= "Microsoft.SharePoint.WebPartPages" assembly= " Microsoft.SharePoint, version=15.0.0.0, Culture=neutral, publickeytoken=71e9bce111e9429c "%>
<%@ Control language= "C #" autoeventwireup= "true" codebehind= "NewListUserControl.ascx.cs" inherits= " TestDemo1.WebParts.NewList.NewListUserControl "%>
<script type= "Text/javascript" >
function ShowDialog () {
var options = {
URL: "/_layouts/page/uploadpage.aspx",
Args:7,
Title: "Select Page",
WIDTH:200,
HEIGTH:200,
Dialogreturnvaluecallback:dialogcallback
};
Sp. Ui. Modaldialog.showmodaldialog (options);
}
Receive return value method
function Dialogcallback (DialogResult, returnvalue) {
Which Dialogresult=1, the representative determined, Dialogresult=0, on behalf of the close
if (returnvalue! = null && DialogResult = = 1) {
alert (returnvalue); Pop-up window
document.getElementById (' Txt_shuru '). Value = ReturnValue;
}
Return
}
</script>
<div>
<input type= "text" id= "Txt_shuru"/>
<input type= "button" id= "Btn_xuanze" value= "select" onclick= "ShowDialog ()"/>
</div>
Called Page (Popup page uploadpage.aspx)
<%@ Assembly name= "$SharePoint. project.assemblyfullname$"%>
<%@ page language= "C #" autoeventwireup= "true" codebehind= "UPLoadPage.aspx.cs" inherits= " TestDemo1.Layouts.Page.UPLoadPage "%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<title> Grandpa's </title>
<script type= "Text/javascript" >
Return value method
function Returnpagevalue () {
Window.frameElement.commitPopup (document.getElementById (' Txt_name '). Value);
}
</script>
<body>
<form id= "Form1" runat= "Server" >
<table>
<tr>
<td><span> Name: </span><input type= "text" id= "Txt_name"/>
</td>
</tr>
<tr>
<td>
<input type= "button" value= "OK" id= "sure" onclick= "returnpagevalue ()"/>
</td>
</tr>
</table>
</form>
</body>
Call the SharePoint self-modal window