Current location - Loan Platform Complete Network - Big data management - How to pass large amounts of complex data between pages
How to pass large amounts of complex data between pages
1. Usually we will use url to pass the value to pass a smaller amount of data, such as some parameters, etc., will use session to pass some global session-level variables. But to pass some more complex data between forms, the session life cycle is too long, may not be appropriate. Using URL to pass values, Chinese characters may be encoded incorrectly, and the maximum amount of data that can be passed is relatively limited.

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);