Copy codeThe Code is as follows: using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Drawing;
Using System. IO;
Namespace web Layer 3
{
///
/// Display the thumbnail of the requested image, in the
In the Asp.net release, most security problems are caused by the following three aspects:
1. Upload
2. Cross-Site
3. Injection
The upload security issue is not covered in this article. Here we only discuss the issue of cross-site and injection, and
1. URL rewriting is common, but basically most URL rewriting does not support relative paths of pages. If you want to add a URL to a developed project, there is still pressure, the second is that, for example, Microsoft's URL rewriting is handled
Copy codeThe Code is as follows: 1. RowCommad
// Obtain the index
Int index = (GridViewRow) (Button) (e. CommandSource). Parent. Parent). RowIndex;
2. RowEditing// Obtain the indexInt index = e. NewEditIndex;// Obtain the current GridViewRow
First, let's take a look at the following code snippet. We hope that you will first submit the data to the specified third-party page when clicking the Button on the page, and then execute the Page_Load event in the background.
Copy codeThe Code is
1. Basic Steps for ASP. NET database operations:
Common Methods for ASP. NET data operations:A. ExecuteReader ()The returned result is a SqlDataReader object or OleDbDataReader object. Each return or operation guides a record to be stored in the
Js:
Copy codeThe Code is as follows: function Save () // Save a value that is not a server control.
{
Var 1 = document. getElementById ('1box'). value;
Var 2 = document. getElementById ('2box'). value;
Var TxtValue = 1 + "■" + 2;
Document.
Final effect:
It is impossible for me to merge the content rows. I have been searching for the Internet for N years and have not found it ~Later, after a short thought, I finally thought of another merger ,:-)The implementation method is simple,
During website development, the following requirements are often met:
1: The page contains hot news. The hot news part needs to be updated every 10 minutes, and the rest of the page will not change within one day;
2: a banner on the homepage needs
Create a solution: Api
Add class library APi. Data
APi. Data creates an Entity
Copy codeThe Code is as follows: public class Entity
{
Private int id;
Public int Id
{
Get {return id ;}
Set {id = value ;}
}
Private string name;
Public string
So far, we have discussed storing cache in ASP. NET output cache (memory and hard disk), and browser cache. Another common practice for large websites is to deploy the cache on the reverse proxy server, this type of cache is generally called reverse
Copy codeThe Code is as follows: 'function: Null Value Test
Function inull (Val)
Dim tmp
Tmp = False
If IsNull (Val) Then
Tmp = True
ElseIf IsEmpty (Val) Then
Tmp = True
ElseIf Trim (Val) = "" Then
Tmp = True
End If
Inull = tmp
End
1. class library to be referenced
Copy codeThe Code is as follows: using System. Net;
Using System. IO;
Using System. Text;
Using System. Text. RegularExpressions;
2. Obtain the key code of the webpage content of other websitesCopy codeThe Code is
Asp checks whether a component is installed on the server, that is, whether a dll file is installed, and whether a component is registered on the server. There are many asp components, which can reduce many asp errors, the following functions are
Common Regular Expression
Regular Expression -- verify mobile phone number: 13 [0-9] {9}If the mobile phone number is 86 or + 86 before it is implemented: ^ (\ + 86) | (86 ))? (13) \ d {9} $Verify the phone number and phone number at the same time:
OutputCache is intended for all users accessing server resources. The browser cache described in this article is intended for individual users, so that the browser does not continuously access the dynamic content on the server under our control,
① During Web development, you may also encounter problems that I encountered before. When using the TextBox Control, the edge of the control cannot be completely overwritten by the background image. 1:
After Textbox resolution, it is also an
1. Global. asax
Files are the centers of ASP. NET applications. It provides numerous events to process different application-level tasks, such as user authentication, application startup, and user session processing. You should be familiar with this
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.