Asp. NET tip: How do you pass complex data with large amounts of data between pages?

Source: Internet
Author: User
Tags array variables
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>



Related Article

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.