No refresh drop-down frame

xiaoxiao2021-03-06  27

Information system development in the network, less use of the drop-down box, sometimes multiple pull-down boxes, hope is no refresh, the following is an XML method. First, Page 1 (Display Page) 1, the client display page, the main code of the server.

If (! page.ispostback) {ddlname.attributes.add ("onchange", "", ",", "); // This is an event of the client call} 2, client HTML main code - Please select - Category 3, client's JS code function load (state) {var drop2 = Document.getElementByid ("DDLVALUE"); / / Clear content var I = 0 in the data source; for (i = drop2.length; i> = 0; i -) {Drop2.Options.remove (i);} // A request to send a request to get a response result VAR OHTTPREQ = New ActiveXObject ("msxml2.xmlhttp"); var = new activXObject ("msxml2.domdocument"); ohttpreq.open ("post", "ddlcreatexml.aspx "State =" state, false; httpreq.send (""); result = OHTTPREQ.RESPONSETEXT ;ODoc.LoadXml (Result); items = odoc.selectnodes ("// rootnodes / table"); for (i = 0; I

DataSet DS = New Dataset ("Rootnodes"); DP.Close (); // The following mainly generates XML XmlTextWriter Write = new xmlTextWriter (response.OutputStream, response.contentence); Write.Formatting = Formatting.indented; Write.indentation = 4; Write.indentChar = '; ds.writexml (Write); Write.Clush (); Write.close (); response.end ();}} 2, remove the page HTML Format 3 Description XML generation mode can be replaced with WebServices, and the response is slightly slow, and the value cannot be saved, and the hidden piece can be used. Another way is that Mr. is a JS array mode, I didn't try it.

转载请注明原文地址:https://www.9cbs.com/read-65589.html

New Post(0)