Call the SharePoint self-modal window

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.