ASP. NET Programming Reading Notes

Source: Internet
Author: User

2011-5-18 evening

(Recall, this note is about reading 1.1 million drops of books and writing down some things that are often forgotten. It will be used up later. Some of them are here, and they feel a bit like tearing up the tabloids before, because this book is quite old. Haha, although it is very basic, it is not as good as a good memory. Continue to cheer up, it's almost finished .)

The amount most often forgotten& Or and(And) and| Or(Or) ----> & when both are true, it is true. | True when one is true

1. Set or return the content between the start tag and end tag of the HTML element. Special characters are not automatically converted.

Innertext (same as above), but this special character will be converted.

Instance: for example, the attribute of innertext is <p> hello! <P/> the output in HTML is & lt; P & gt; Hello! & Lt;/& gt;

2. An attribute that is often forgotten: cell is a cell, padding, spacing, distance

Cellpadding --> the distance between the border and content (PX)

Cellspacing-> distance between cells (same as above)

3. Relative Path: for example: ../Hello/Xiaoxing/login. aspx

Absolute path: for example, www.cnblogs.com/lookyou

4. Pop-up message box

Page. clientscript. registerclientscriptblock (This. GetType (),"Warning","Alert ('prompt box ')",True);

// Prevent the background from being white after the pop-up box

Page. clientscript. registerstartupscript (page. GetType (), "message", "<script language = 'javascript 'defer> alert ('the verification code is incorrect or cannot be blank. Please try again! '); </SCRIPT> ");

5. Background attributes of CSS

Background-repeat: whether to repeat the background image by default. The default value is X and Y axis. This parameter must be used with background-images)

Background-Attachment: fixed; determines whether to scroll together with the content. The default value is fixed. (To be used with background-images)

6.

7. The most frequently used hyperlink Style

A: Link, A: visited {/* The hyperlink style that the mouse has not moved up, and the style after the hyperlink is accessed */Color: #000; text-Decoration: none;} A: hover {/* Move the mouse over the hyperlink */Color: # 00f; text-Decoration: underline ;}

 

8.

Effect:

ImplementationCode:

 

9.

Implementation Code:

 
# Right {background-color: Blue; Height: 100px; }# left {background-color: red; width: 300px; Height: 100px;Float: Left ;}# buttom {/* clear floating clear: Both */clear: Both; Height: 100px; Background-color: Gray ;}

 

10. When I create a topic page today, I encounter the page_preinit event, which is used to load personalized information and page topics (if any ).

Msdn: http://msdn.microsoft.com/zh-cn/library/system.web.ui.page.preinit (vs.80). aspx # y182

My applications:

 
VoidPage_preinit (ObjectSender, eventargs e ){If(Session ["Mytheme"]! =Null) {// The theme attribute is called in the page_preinit event.
 
This. Theme = session ["Mytheme"]. Tostring ();}Else{// Put the skinfile In the session. session ["Mytheme"] ="Skinfile";}}

11. Switch the topic, provided that

A new skin file skinfile and skinfile2 are created;

Protected VoidButton#click (ObjectSender, eventargs E)

{

Session ["Mytheme"] ="Skinfile";

Response. Redirect (request. url. tostring ());

}

Protected VoidButton2_click (ObjectSender, eventargs E)

{

Session ["Mytheme"] ="Skinfile2";

Response. Redirect (request. url. tostring ());

}

12.

In the case of a master page, the sequence of common event processing is as follows:

Step 2: page_preinit of the Content Page

Step 2. page_init of the master page

Step 2: page_init of the Content Page

Step 2: page_initcomplete on the Content Page

Step 2: page_preload of the Content Page

Step 2: page_load of the Content Page

Step 2: page_load of the master page

Send back events such as Button clicking on step 2, master page or content page (Button events of Master or content will not be triggered at the same time)

Step 2: page_loadcomplete on the Content Page

Step 2: page_prerender of the Content Page

Step 2: page_prerender on the master page

Step 2: page_prerendercomplete on the Content Page

Step 2: page_savestatecomplete on the Content Page

Step 2: page_unload on the master page

Step 2: page_unload of the Content Page


13. Structure of ADO. net

Msdn: http://msdn.microsoft.com/zh-cn/library/27y4ybxw

14. New Ajax brushless Technology --- (development code: Atlas)

To distinguish other Ajax technologies, Microsoft adds ASP. NET Ajax (Ajax is capitalized and ASP. NET is added before)

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.