Status: When multiple web servers are load balance, if the XML string stream is used as a data source to TreeView, the speed will be slow. Under normal circumstances, it will not be found, but there is a reason: TreeView and Treenode data binding, the incoming XML is treated as a URL. After an error, it is treated as an XML stream. In the case of multiple servers, since the page is uncertain, since the page is uncertain, it is said that its URL is uncertain, and it is directed to a server by the load balancing mechanism. Correction method: Add an attribute TreenodesrcisxmlStream to set whether the XML is a string stream. Modifying method READXMLSRC Description: First determine whether it is XML according to the attribute, rather than using an exception handler to determine the perfect point, then add a method ISXML call when taking the attribute, if the attribute is empty, use this method to determine the TREENODESRC type function: judgment Whether the string is an XML parameter: String Str To determine the string
Source: try {reader = GetXmlReaderFromUri (TreeNodeSrc, TreeNodeXsltSrc); bReading = reader.Read ();} catch {// could not read Try TreeNodeSrc as a string reader = GetXmlReaderFromString (TreeNodeSrc, TreeNodeXsltSrc); if (reader..! = NULL) BREADING = Reader.Read ();
Read: if (TreeNodeSrcIsXmlStream) {reader = GetXmlReaderFromString (TreeNodeSrc, TreeNodeXsltSrc); if (! Reader = null) bReading = reader.Read ();} else {reader = GetXmlReaderFromUri (TreeNodeSrc, TreeNodeXsltSrc); bReading = reader.Read ( }
There may be also existed in HTC, not to see code, the principle of change.
Conclusion: Use try ... catch ... this abnormal processing mechanism for conditional judgment is not good D behavior.