When I use viewport of extjs in Asp.net, a certain area is embedded into an Asp.net area in contentel mode. A problem occurs: the server button event in Asp.net cannot respond.
By viewing the HTML (document. Body. innertext = Document. Body. innerhtml;) output on the page, we can find that the content generated by extjs viewport is directly placed under the body node. The Asp.net control can only respond to the control event under the Form Control.
Solution: After viewport. Render () is executed, move all content in the body to form. The corresponding functions are as follows:
1 // Add extjs content to form
2 Function initformcontrollocation (){
3 Parenttarget = Document. Forms [ 0 ];
4 For (I = Document. Body. childnodes. Length - 1 ; I > - 1 ; I -- ){
5 Tag = Document. Body. childnodes [I]. tagname;
6 If (Tag. touppercase () ! = ' Form ' ){
7 OBJ = Document. Body. removechild (document. Body. childnodes [I]);
8 Parenttarget. insertbefore (OBJ, parenttarget. firstchild );
9 }
10 }
11 }
* I personally feel that extjs supports Asp.net, but I have never found a method. After reading the extjs source code, I tried to change the Ext. getbody method, but it didn't work. -- joyyuan97
If you have other implementation methods, please leave a message.