Asp.net| Tips | data | page
1. Usually we will use the URL to pass the value of a small amount of data, such as some parameters, will be used to pass some global session-level variables. However, to pass some more complex data between forms, it may not be appropriate to use the session life cycle too long. By using a URL to pass a value, the Chinese character 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 modal dialog to realize data transfer across the page,
The Dialogarguments property of the modal dialog box can be obtained by using the following methods:
var Variables = window.dialogarguments
This property allows you to get the incoming arguments for the modal dialog box, which can be string, numeric, object, or array value that specifies arguments. In particular, parameters for object or array type are useful for passing data between pages. Examples are as follows:
Incoming page:
<HTML>
<HEAD>
<SCRIPT>
function AddNew (meetingid) {
var obj=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/meetingpublishedlist.aspx "; }
</SCRIPT>
</HEAD>
<BODY>
<button >launch the Window</button>
</BODY>
</HTML>
Receive page:
<HTML>
<HEAD>
<SCRIPT>
var omyobject = window.dialogarguments;
var name= omyobject.name;
var tel= omyobject.tel;
</SCRIPT>
<title>Untitled</title>
<body style= "font-family:arial; font-size:14pt; Color:snow;
Background-color:rosybrown; " >
Name:
<span style= "color:00ff7f" >
<SCRIPT>
document.write (name);
</SCRIPT>
</SPAN>
<BR>
Tel:
<span style= "color:00ff7f" >
<SCRIPT>
document.write (tel);
</SCRIPT>
</SPAN>
</BODY>
</HTML>