2. We can use the dialogArguments property of a modal dialog to achieve cross-page data transfer,
The dialogArguments property of a modal dialog can be obtained in the following way:
var Variables = window. dialogArguments
Using this property, you can get the incoming parameters of the modal dialog, which can be String, numeric, object, or array value that specifies arguments. Especially object or array type arguments are very useful for passing data between pages. Examples:
Passing to the page:
function AddNew(meetingID) {
var bj=new Object();
obj.name="qiubinchao";
obj.tel="12345678"; var strUrl=". /MeetingManage/NewMeeting.aspx?id=" +meetingID; window.showModalDialog(strUrl,obj, "dialogHeight:700px;dialogWidth=900px;dialogTop= 10px;dialogLeft:50px;"); window.location=".../MeetingManage/MeetingManage/MeetingLeft:50px;"); window. /MeetingManage/MeetingPublishedList.aspx"; }
Receive page:
var MyObject = window.dialogArguments;
var name= oMyObject.name;
var tel= oMyObject.tel;
Name:
document.write(name);
Tel:
document.write(tel);