Use the extjs viewport + Asp.net control in Asp.net

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.