[Original] basic: Second, exquisite ext message frame.

Source: Internet
Author: User

Exquisite message box

It feels as hard as writing a book, but I have the spirit of playing games, and it's hard and easy.

If you see the above, you should have ext2.2 files in your hand now.

Once again, unless otherwise stated, all programs are on the premise of 2008 C #. net. Although ext doesn't care what language you are using, I only use. net.

Well, create a new website, copy the ext2.2 file you downloaded to any directory on the website, and set the correct path on the page, as shown in:

It should be noted that in the future, all programs will not list the entire page and only write statements between <body> </body>.

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>

// The following is a required file for the entire ext framework. It is not required except for Chinese ing.
<LINK rel = "stylesheet" type = "text/CSS" href = "../extjs/resources/CSS/ext-all.css"/> // Style File
<SCRIPT type = "text/JavaScript" src = "../extjs/adapter/EXT/ext-base.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "../extjs/ext-all.js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "../extjs/ext-lang-zh_CN.js"> </SCRIPT> // Chinese ing
</Head>

<% -- This is the header of an Asp.net page. Enter the correct path to access ext in the header. Note the sequence, but it cannot be reversed.

With the correct reference above, we will start practical drills.

Well, we started from the Hello world! -- %>

<Body>
<Form ID = "form1" runat = "server">
<Div>
<% -- Since ext is based on JavaScript, We need to wrap ext's stuff in JavaScript -- %>
<SCRIPT type = "text/JavaScript">
// Define a function and define a pop-up button in it. When a pop-up button appears on the webpage, the Hello world will appear when you click it.
Function ready ()
{
// The following openms is the function executed after the event is triggered.

VaR openmsg = function ()
{
// Alert ("good"); compares the exclusive pop-up message box of Ext.
Ext. msg. Alert ("prompt message, which can be customized", "Hello world-Hello World ");
};

// Define the ext button
VaR pop-up button = new Ext. Button
({
ID: "btnopen", // define the button ID
Text: "pop-up button", // define the button title
Handler: openmsg, // defines the event triggered by the button. After handler, write the function name openmsg directly.
// It can also be written as follows. The essence is the same and the effect is the same.
// Handler: function () {Ext. msg. Alert ("message, customizable", "Hello world-Hello World ");},
Renderto: Document. Body // render the pop-up button to the form
});
}
Ext. onready (ready); // The parameter in it is the function defined above.

// Onready is the entry to use Ext. Only after all the above mentioned ext frameworks are loaded will ext be executed. the functions contained in onready are defined by the onready method of Ext.

// Of course, The onready ext method has a total of three parameters. For simplicity, here we use a parameter, which will be explained in detail in the article on improvement.

</SCRIPT>
</Div>
</Form>
</Body>
</Html>

The above is a complete Asp.net webpage. After the path is correct, it can be displayed directly on the page.

Exquisite message box

In addition, all message boxes of ext are encapsulated in the Ext. MSG class.

 

 

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.