Summary of recent ASP. NET problems and corresponding solutions, recently asp.net
1. Use SQL to count the number of specified characters in a string. For example (count the number of 0 characters ):
select len('402301001') - len(replace('402301001','0',''))
2. If Forms authentication is used, the client cannot log on to the system at a wrong local time. solution:
FormsAuthentication. RedirectFromLoginPage the second parameter is set to false, MSDN information: http://msdn.microsoft.com/zh-cn/library/ka5ffkce (v = vs.110). aspx
3. The CPU usage of the website server is. Find the website caused by IIS:
① First, set the view mode of the task manager and add the PID display;
② Use the C: \ Windows \ System32 \ inetsrv> appcmd list wp command to locate the specific website PID (the command in Server 2008 is here, and Server 2003 is the iisapp-a command );
4. attr ("checked") in jQuery1.6 is invalid. The correct syntax is as follows:
Three methods: if (elem. checked) or if ($ (elem). prop ("checked") or if ($ (elem). is (": checked "))
Official documents: http://api.jquery.com/attr/
5. n log files with multiple log4net types can only be searched using editplus. Solution: Use Log Parser Lizard or SQL SERVER to write queries.
6. The website prompts that an error occurred while accessing the IIS metadatabase. solution (command): aspnet_regiis-ga ASPNET
7. How to enable the Remote Desktop Task Manager: Ctrl + Shift + Esc
8 .. NET2.0 serialized DataSet serialized as json, json deserialization into DataSet: http://json.codeplex.com/
9. quickly generate organization chart with EXCEL Data: http://www.visio123.com/Visio_2010/Visiokuachengxushiyong/20130225/33.html
10. Set the size of the web. config file to be uploaded (Windows Server 2008 is different from the previous Windows Server 2003 settings ):
In Windows Server 2003, web. config is configured to add the following configuration under the system. web node:
<!--100MB-->
In Windows Server 2008, web. config must add the following configuration under the system. webServer node:
<security> <requestFiltering> <requestLimits maxAllowedContentLength="102400000" /> </requestFiltering></security>
For more information, see http://www.cnblogs.com/henryhappier/archive/2010/09/20/1832098.html. In actual tests, it is found that an exception occurs when the file is configured to 102400000 to 20 mb. If the file is configured to 1024000000, it will be okay ......
For problems encountered by ASPnet, HTTP Error 404-Not Found
404 indicates that the corresponding webpage is not found, rather than the corresponding image is not found. Therefore, we recommend that you check the output webpage file address and CommonPage. whether the two files aspx exist.
ASPNET question, answer
Method 1: This error occurs because the virtual directory of the website is not set. The most effective solution is to directly configure the website as a site in IIS.
Method: in IIS, click the virtual directory of your source code, right click-> properties-> Application name-> Create
That is, the web. config file must be in the root directory of the site.
If you press F5 in VS to see this error, modify the path of the site in the sln file.
Suggestion: directly configure the site under IIS instead of debugging in.
Note: create a virtual directory under the root directory of the site. If the problem persists, create a site (or point the root directory of the site to the root directory of the current program, that is, the directory where web. config is located)
Method 2: Sometimes it cannot be used. You can try this method.
Install. NET 2005 first, and IIS later. The program runs normally under. NET, and an error is reported in IIS:
The server application is unavailable.
Solution:
Cmd to C: \ WINDOWS \ Microsoft. NET \ Framework \ v2.0.50727Y4ZG
Run aspnet_regiis.exe space-I
The installation of ASP. NET is displayed, and the problem is resolved after installation.
Method 3: The virtual directory points to the folder where web. config is located, because some configuration sections of web. config can only appear in the virtual directory and directory of the website. Remove unnecessary ones and leave one.
Method 4. If no application name exists in IIS, create it first. If not, set C: \ WINDOWS \ Microsoft. NET \ work \ v2.0.50727 \ CONFIG \ machine. change all allowDefinition = "MachineToApplication" in config to allowDefinition = "Everywhere". Use it with caution. If it is changed, other errors may be reported.
Method 5: point your virtual directory to the folder where web. config is located, because some configuration sections of web. config can only appear in the virtual directory and directory of the website.
Others: if you are using iis for debugging, you need to set the website or virtual directory as an application.
The reference is missing. Check the code again.