Experience in ASP. NET Website Construction on the Godaddy server (1)

Source: Internet
Author: User
Tags godaddy server

Recently, an ASP.. NET website, a host purchased on Godaddy. (By the way, we despise domestic domain name host service providers, which are expensive and poor. technicians often modify servers at will, causing unpredictable problems .) let's talk about some experience in website construction and use. (for commercial reasons, I cannot disclose the website. Sorry .)

I encountered some problems during the construction and use process. I searched the internet for a long time and many of them did not have a good solution. Fortunately, my website is already running perfectly, so I want to help the comrades who have encountered similar problems. (I think it's a strange problem. not easy for programmers

 

1. server host

 

As mentioned above, if the domestic network speed requirements are not very high (normal access is okay, fast .), it is recommended to purchase from Godaddy, which is very cheap. my 150 GB Windows host and domain name paid about $200, with an independent IP address (now cheaper ). their services are okay, And all emails sent to them are returned.

 

2. ASP. NET, JAVA, PHP.

 

Now it seems like a similar comparison with the popular ones. As a programmer, I come here to understand it.
My opinion is: It doesn't matter.

ASP. NET, JAVA, PHP, etc. It is just a tool, as long as you can achieve your business purpose and achieve functional performance requirements. as a boss, I don't care what language you use (my words may be vulgar, but they are facts ). therefore, you only need to select one that you are familiar with or prefer to use. for myself, because I have developed C ++/MFC before and now achieved Visual Studio 2005, ASP is used. NET.

 

Programming is the same in the future. It's just something that comes and goes. I can't tell you what the essence is, just a little bit of feeling. like the operating system, isn't Windows or Linux all that stuff? Why can I use the POXIS specification to write unified code for system programming? I think it is because all operating systems are similar in nature and always use threads, files, processes, communications, synchronization, and so on. the same is true for websites. It is nothing more than dynamic response streams based on user requests, regardless of JAVA, ASP. NET and PHP are the same at this point, and the implementation is also similar.

 

If you are a newbie, don't worry too much about language tools. Choose one that you can see and use. after being proficient, you can bypass the class. if you are proficient in ASP. NET, let you write JAVA code, it is estimated that there will be 2 weeks of training, enough. the opposite is true.

 

I want to say that the difficulty lies in how the artist typeset and colors make the webpage look pleasing to the eye...

 

3. The biggest problem is that
"An error occurred while verifying the view status MAC. If this application is hosted by a network farm or cluster, make sure that the <machineKey> Configuration specifies the same validationKey and verification algorithm. AutoGenerate cannot be used in a group ."

 

I have summarized it and found that this yellow page error is more likely to occur in the following cases: After opening the webpage, put it for a while, probably when the Session expires, then perform a Postback operation.

 

In fact, my website has only one host, and it cannot be any cluster. According to some tips from Gooogle, I did not use the control bound to the database. (I have always been disgusted with database binding controls and like my own orchestration results .)
At the beginning, I found an article (the specific content was forgotten), saying that it was not safe to set all encryption such as ViewState to "Never, it also has no effect (at least I have no effect here ).
Later, I couldn't help it. I tried it on the web. the <machinekey> configuration is added to config, And the configuration is successful. This yellow page is never seen again. (The website has been running stably for six months .)

 

Therefore, based on the yellow page prompts and actual experience, it is determined that different machinekeys are used. according to Microsoft's instructions, a different machinekey should not be generated after the same website instance runs on the same machine, but there may be any bugs.. net Framework in some cases. config is not specified, and it generates a random machinekey, which leads to a different result from the previous one. after you specify the machinekey ,.. net Framework is no longer generated repeatedly, so there will be no decryption failure issues.

 

The above is my personal guess, which has not been tested and theoretically verified. If you have any opinions, please let me know. Thank you very much.

In addition, http://aspnetresources.com/tools/keycreator.aspx
You can generate a machinekey and put it in your web. config. You can also generate a machinekey by yourself and google the relevant code.

 

4. Master page



The use of the master page makes it easy to maintain a uniform style for all webpages, but it also brings about some problems: the Control ID will be automatically modified.
I don't like this. I wrote code. Why should I change my name? It is very troublesome to compile a lot of JavaScript code.
I wonder if you can achieve the same purpose without using the master page (maintain a unified style )?

5. Questions about Session_End execution



Because the website is small and has only one host, all sessions are stored in the memory and the user status is set in Session_End to count the number of online users.
After running for a period of time, I found that Session_End is often not executed. It is definitely not a code problem. I did not have a problem during testing on the local machine. Maybe it is due to heavy server pressure or other reasons.
Later, by accident, I upgraded the server to IIS7.0 (previously IIS 6.0) and found that the execution of Session_End had improved significantly, probably over 95%. There are three possible reasons:
(1) The software and hardware environment of the server is faulty because the server will be migrated to another server after being upgraded to ISS 7.0.
(2) For IIS program problems, maybe IIS6 has any bugs and it has been fixed in IIS 7.
(3) I am on the web. config specifies the Session configuration, although all are default configurations, but all are explicitly written in <sessionState mode = "InProc" timeout = "20"> </sessionState>, according to the experience of "MAC Verification Failed", I was scared.

In short, the above three changes have been made, and the execution of Sesssion_End has roughly met the requirements. The online user count statistics are very accurate. unfortunately, my conditions here do not allow me to perform further tests to find out which is the real reason. if you have any results, please let me know. Thank you very much.

6. Database Paging

Databases are my weakness. When there is a large amount of data, it is best to perform paging queries. However, I have not done it here. The main reason is that the website is not large in size and there is no need for it.

 

What new experience in the future, I will continue to update this article, if you have any experience, welcome to exchange. querw@sina.com

 

Let's talk about another topic. The album of the MI line's <Tanggula> is really nice -_-!

 

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.