Use the splitcontainer control of dojo in Asp.net

Source: Internet
Author: User
ArticleDirectory
    • How to use a widget in Dojo
    • Notes for use with Asp.net

Programming for winform in vs2005, with the splitcontainer control available; webform does not have such a thing. I asked Mr. Zhao, and he said, "Try the splitcontainer of dojo." So I checked n more information and finally got it done for one day. Next I will summarize my experiences. :

How to use a widget in Dojo
  1. Go to the official website to download the latest version of dojo, Which is 0.4.1.
  2. Decompress the package and place it in the JS directory under the project directory.
  3. making such a reference within the mark of a webpage allows js to read the Dojo-related namespace Script Type = " text/JavaScript " SRC = " JS/dojo. JS " > script >
  4. To reference control-related classes in this way, for example, splitcontainer is used in this article.Dojo. Require ("Dojo. widget. splitcontainer");
    Dojo. Require ("Dojo. widget. contentpane");
  5. Because dojo is open-source, you can find the use method of the corresponding control in the directory of dojo \ tests \ widget, and you can find instructions for each method here.
  6. According to the sample, this can make splitcontainer take effect. The orientation of splitcontainer determines whether it is horizontal or vertical. The border attribute in the style determines the style of the separator. The two contentpane determine to be divided into two columns, and the overflow setting to auto determines that the content on both sides of the left and right does not overlap when the separator bar is dragged. < Div ID = "Splitcontainer1" Dojotype = "Splitcontainer"  
    Orientation = "Horizontal"
    Sizerwidth = "5"
    Activesizing = "False"
    Style = "Border: 1px solid black; float: Left; width: 100%; Height: 100% ;" >
    < Div ID = "Contentpane1" Dojotype = "Contentpane" Sizemin = "20" Sizeshare = "20" Style = "Overflow: Auto" >
    <! -- Content on the left -->
    </ Div >
    < Div ID = "Contentpane2" Dojotype = "Contentpane" Sizemin = "50" Sizeshare = "50" Style = "Overflow: Auto" >
    <! -- Content on the right -->
    </ Div >
    </ Div >
Notes for use with Asp.net
  1. Because the tag used by dojo does not comply with the xhtml1.0 specification, you must remove the statement stated at the beginning of webform. Otherwise, it cannot be used.

    <!Doctype HTML public"-// W3C // dtd xhtml 1.0 transitional // en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. Considering that most people who use this left/right column structure need to contract one side at the same time, write the following Code Implement it. Note that onclick = "FAC (event)" should be written in this way during the call to be compatible with IE and ff. Function FAC (EVT)
    {
    EVT = EVT ? EVT: window. event;
    VaR Otarget = EVT. srcelement | Evt.tar get;
    Otarget. Disabled = " Disabled " ;
    If ( ! Dojo. widget. byid ( " Splitcontainer1 " ). Ishide)
    {
    Dojo. widget. byid ( " Splitcontainer1 " ). Removechild (Dojo. widget. byid ( " Contentpane1 " ));
    Dojo. widget. byid ( " Splitcontainer1 " ). Ishide = True ;
    Otarget. Value = " > " ;
    }
    Else
    {
    Dojo. widget. byid ( " Splitcontainer1 " ). Removechild (Dojo. widget. byid ( " Contentpane2 " ));
    Dojo. widget. byid ( " Splitcontainer1 " ). Addchild (Dojo. widget. byid ( " Contentpane1 " ));
    Dojo. widget. byid ( " Splitcontainer1 " ). Addchild (Dojo. widget. byid ( " Contentpane2 " ));
    Dojo. widget. byid ( " Splitcontainer1 " ). Ishide = False ;
    Otarget. Value = " < " ;
    }
    Otarget. Disabled = "" ;
    }
  3. If you want to use the msajax control together, for example, if you want to use updatepanel, do not place the entire splitcontainer in an updatepanel. You should try to put several columns as much as possible. Otherwise, after the callback, the class attribute of the DIV label on the page disappears without a trace, causing the dojo control to become invalid.
  4. Removing the declaration starting with XHTML will produce a complication. Some Ajax Control Toolkit controls will be abnormal!
Related Article

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.