The structure of the Hjr-asp.net:asp.net website

Source: Internet
Author: User

Let's record a few common sense

The three-mesh operator a?b:c A simple way of understanding: if (A is true) {RETURNB} Else{RETURNC, where a can be a formula

Invoke API Cloud, do not use jquery Jquery.ready or JS Function.ready, directly using Api.ready log file is used to record the program, such as to a class, in the first sentence of the class plus log.xxx (), Generally write a log tool class, which has the level of judgment, for example, Info,debug,error different levels of output information call different methods, when the tool class calls, in the engineering directory to generate a log folder, log information in the form of text saved into the inside

Record a few details to be aware of doing software

(1) If the page card, you may need to increase the server bandwidth, if the user upload a picture too large will make the page card, you can limit the upload image size, if the picture is not loaded, you can first load a blank, then Ajax, and then load pictures to prevent jammed.

(2) Software user interface as much as possible to do, sometimes have to do the page temporarily can not operate to wait for loading restrictions, to prevent the current page is already stuck, the user also continue to operate, so that it becomes more card

First you need to have a routing ashx file that is responsible for receiving and processing URL parameters

This file is made up of two parts

1, the URL receives the function to write a state machine with the switch, the root different parameter calls the different method

public void ProcessRequest (HttpContext context)
{
Context. Response.ContentType = "Text/plain";//declaring return type, the server returns a paragraph (text) to the client
String para = context. Request["Para"];
Switch (para)
{

}

}

2, each state corresponds to a method, the content of the method is to manipulate the database and logical judgment, and then output string of HTML code to visit his foreground page

String html = null;

Html+=string. Format (<xxxx>);

Html+=string. Format (<xxxx>);

HttpContext.Current.Response.Write (HTML);

Then you need to have a template folder to store HTML template files and save your favorite HTML inside

Loading a template using the {include:/template/xxx.html} method

A portal file index.aspx or default.aspx

Inside generally only Response.Redirect ("xxx.aspx?para1=xx&para2=xx"); Jump to an ASPX page and do some processing, home main navigation and main frame

Then, according to the different parameters Ajax access to the previous ashx file, get different HTML to the page asynchronous update




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.