I. There are about three forms of passing values between pages through JS
1 window. The value is passed by opener. The child page can obtain the window object of the parent page. Of course, the object value can be obtained. This method does not have the length limit for transferring values and cannot be cross-origin.
2. There is a limit on the length of the cookie value.
3. The value is also restricted, but cross-origin is supported.
Ii. ASP. NET page value transfer
1. Add "?" After the querystring variable (or URL) Address
2. Pass the session value. (Server)
3. Set applica values. (Global, the best example is the online access volume)
4. Cookies. (Client save)
5
Httpcontext, that is, server. Transfer (). Note the difference between it and redirect.
Iii. js access background variables (1 and 2 are used more)
1. Access <input id = "hidencontrol" type = "hidden" runat = "server"> through a hidden control on the page (note that runat = "server ")
2. <% = Object Name %> if the object is pubulic's
3. register the function "<script language = 'javascript '> value =" + variable name + "</SCRIPT>" to access the value.
Iv. Access JS variables in the background
1 is also hidden
2 cookie or session
5. js calls background Functions
1 Document. getelementbyid ("btn1"). Click ();
2 var F = "<% = function () %>"; alert (f );
Six backend calls JS
1. Register JS Functions
2 Use literal