Some things in the last blog that didn't take into account this change the code as follows:
Foreground of the interface:
Copy Code code as follows:
<%@ Page language= "C #" autoeventwireup= true "codebehind=" AdmShowDIV.aspx.cs "inherits=" ExamSystemV3.Manager.RoleManager.AdmShowDIV "%>
<! DOCTYPE html>
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 "/>
<meta name= "Author" content= "kudychen@gmail.com"/>
<meta http-equiv= "x-ua-compatible" content= "Ie=emulateie7"/>
<title></title>
<script src= ". /.. /js/div/jquery.js "type=" Text/javascript "></script>
<script src= ". /.. /js/div/div.js "type=" Text/ecmascript "></script>
<link href= ". /.. /css/admin.global.css "rel=" stylesheet "type=" Text/css "/>"
<link href= ". /.. /css/admin.content.css "rel=" stylesheet "type=" Text/css "/>"
<script type= "Text/javascript" src= ". /.. /.. /js/jquery.easyui.min.js "></script>
<script type= "Text/javascript" src= ". /.. /js/jquery-1.4.2.min.js "></script>
<script type= "Text/javascript" src= ". /.. /js/jquery.utils.js "></script>
<link href= ". /.. /jbox/skins/green/jbox.css "rel=" stylesheet "type=" Text/css "/>"
<script type= "Text/javascript" src= ". /.. /jbox/jquery.jbox-2.3.min.js "></script>
<script type= "Text/javascript" src= ". /.. /js/admin.js "></script>
<script type= "Text/javascript" src= ". /.. /js/simpletree.js "></script>
<body>
<form id= "Form1" runat= "Server" >
<div class= "Container" >
<div class= "Location" > Current Position: interface element Management-> view interface elements </div>
<div class= "Blank10" ></div>
<div class= "Search Block" >
<div class= "H" >
<span class= "Icon-sprite icon-magnifier" ></span>
</div>
<div class= "TL Corner" ></div><div class= "tr Corner" ></div><div class= "BL Corner" ></ Div><div class= "BR Corner" ></div>
<div class= "CNT-WP" >
<div class= "CNT" >
<div class= "Search-bar" id= "Selectrole" >
<label class= "Txt-green" > Please select Interface:</label>
<asp:dropdownlist id= "Ddlwindowsname" runat= "Server" autopostback= "True" onselectedindexchanged= "DdlWindowsName" _selectedindexchanged ">
</asp:DropDownList>
<a class= "Btn-lit" href= "#" onclick= "Windowsinfo ()" ><span> Scan interface Information </span></a>
</div>
</div>
</div>
</div>
</div>
<div class= "Block" >
<div class= "H" >
<span class= "Icon-sprite icon-list" ></span>
</div>
<div class= "TL Corner" ></div>
<div class= "TR Corner" ></div>
<div class= "BL Corner" ></div>
<div class= "BR Corner" ></div>
<div class= "CNT-WP" >
<div class= "CNT" >
<iframe id= "frmwindows" runat= "server" frameborder= "0" marginheight= "0" marginwidth= "0" scrolling= "Auto" style= " Display:inline; height:400px "width=" 75% "></iframe>
<iframe id= "Frmupdatediv" runat= "server" frameborder= "0" marginheight= "0" marginwidth= "0" scrolling= "Auto" style= " Display:inline; height:400px; width:24%; " ></iframe>
</div>
</div>
</div>
</form>
</body>
Interface background:
Copy Code code as follows:
Using BLL. MANAGER.ROLEUSERMANAGERBLL;
Using System;
Using System.Collections.Generic;
Using System.Data;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Namespace ExamSystemV3.Manager.RoleManager
{
public partial class AdmShowDIV:System.Web.UI.Page
{
protected void Page_Load (object sender, EventArgs e)
{
String Strlike= "";
if (! IsPostBack)
{
Binding interface
Databindwindows (Strlike);
}
}
<summary>
Bind all Interfaces
</summary>
<param name= "Strlike" ></param>
public void Databindwindows (string strlike)
{
DataTable dt = new DataTable ();
Admwindowsmanager Admwindowsmanager = new Admwindowsmanager ();
Find all the interfaces
DT = Admwindowsmanager.querywindowinfo (strlike);
Binding interface Information
Ddlwindowsname.datasource = DT;
Ddlwindowsname.datavaluefield = "Id";
Ddlwindowsname.datatextfield = "Windowsname";
Ddlwindowsname.databind ();
}
protected void Ddlwindowsname_selectedindexchanged (object sender, EventArgs e)
{
DataTable dt = new DataTable ();
String strlike = "";
Admwindowsmanager Admwindowsmanager = new Admwindowsmanager ();
Find out the information of the interface
DT = Admwindowsmanager.querywindowinfo (strlike);
String strwindowsid=ddlwindowsname.selectedvalue.tostring (). Trim ();
Strlike = "Id= '" "+strwindowsid+" ";
datarow[] Rows =dt. Select (Strlike);
Get path
String strURL = rows[0]["Windowsurl"]. ToString ();
strURL = ".. /.. /"+ strURL;
frmwindows.attributes["src"]=strurl;
frmupdatediv.attributes["src"] = "admupdatediv.aspx?" Windowsid= ' "+ strwindowsid +" ' ";
}
}
}
Js:
Copy Code code as follows:
var windowsid;
function Windowsinfo () {
Get Ifrm
var frmwindows = document.getElementById ("Frmwindows"). Contentwindow;
Get interface ID
Windowsid = document.getElementById ("Ddlwindowsname"). Value;
var rootboxs = frmWindows.document.getElementById ("main");
var child = Rootboxs.childnodes;
Findchildbox (child);
};
Searching child nodes
function Findchildbox (parentnode) {
for (var i = 0; i < parentnode.length; i++) {
if (Parentnode[i].nodename = = "box") {
var childboxid = parentnode[i].id;
var childboxtitle = encodeURI (Parentnode[i].title);
var parentbox = Findparentbox (Parentnode[i].parentnode);
var parentboxid = parentbox.id;
if (window. XMLHttpRequest) {
IE7 above,firefox,chrome^^
XMLHTTP = new XMLHttpRequest ();
In order to be compatible with the partial Mozillar browser, when the response from the server is not XML, the resulting unresponsive problem
if (Xmlhttp.overridemimetype) {
Xmlhttp.overridemimetype (' Text/xml ');
}
}
else if (window. ActiveXObject) {
Ie5\ie6
XMLHTTP = new ActiveXObject ("Microsoft.XMLHTTP");
}
if (xmlhttp = null | | xmlhttp = = undefined) {
Alert ("Con ' t create XMLHttpRequest Object");
}
Registering callback Functions
Xmlhttp.onreadystatechange = callback;
Send a message
Xmlhttp.open (' Get ', '.. /.. /manager/rolemanager/addbox.ashx?childboxid= ' + childboxid + ' &childboxtitle= ' + childboxtitle + ' &parentboxId = ' + parentboxid+ ' &windowsid= ' +windowsid, true);
Xmlhttp.send (NULL);
function callback () {
Determines whether the interaction is complete and returns correctly
if (xmlhttp.readystate = = 4 && xmlhttp.status = 200) {
// }
//}
}
Findchildbox (Parentnode[i].childnodes)
}
}
Querying the parent node
function Findparentbox (child) {
if (Child.nodename = = "box") {
return to child;
} else {
Return Findparentbox (Child.parentnode)
}
}
General handlers:
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using BLL. MANAGER.ROLEUSERMANAGERBLL;
Using System.Data;
Using System.Text;
Using Model;
Using BLL;
Namespace ExamSystemV3.Manager.RoleManager
{
<summary>
Summary description of Addbox
</summary>
public class Addbox:ihttphandler
{
public void ProcessRequest (HttpContext context)
{
Context. Response.ContentType = "Text/plain";
System.Threading.Thread.Sleep (1000);
Diventity ediv = new diventity ();
Tr_windowsdiventity ewindowsdiv = new tr_windowsdiventity ();
Admdivmanager Admdivmanager = new Admdivmanager ();
PUBLICBLL PUBLICBLL = new PUBLICBLL ();
Gather information
String strchildboxid = "";
String strchildboxtitle = "";
Strchildboxid = context. request.querystring["Childboxid"]. ToString (). Trim ();
Strchildboxtitle = context. Server.urldecode (context. request.querystring["Childboxtitle"]. ToString (). Trim ());
String Strwindowsid = context. request.querystring["Windowsid"]. ToString (). Trim ();
String Strparentboxid=context. request.querystring["Parentboxid"]. ToString (). Trim ();;
String strstate = "Yes";
String strdatetime = Publicbll.getdate ();
String StrIP = Publicbll.getwebclientip ();
String stroperator = "Xvshu";//context. session["Userno"]. ToString (). Trim ();;
Assign a value to an entity class
Ediv.id = Strchildboxid;
Ediv.mainrelation = Strparentboxid;
Ediv.divname = Strchildboxtitle;
Ediv.divdescribe = Strchildboxtitle;
Ediv.operator = Stroperator;
Ediv.operatorip = StrIP;
Ediv.state = strstate;
Ediv.datetime = Strdatetime;
Assigning values to Windowsdiv entity classes
Ewindowsdiv.divid = Strchildboxid;
Ewindowsdiv.windowsid = Strwindowsid;
ewindowsdiv.isvisible = "Yes";
Ewindowsdiv.operator = Stroperator;
Ewindowsdiv.operatorip = StrIP;
Ewindowsdiv.datetime = Strdatetime;
Add Div
Admdivmanager.adddiv (EDIV,EWINDOWSDIV);
}
public bool IsReusable
{
Get
{
return false;
}
}
}
}