Where the size of the uploaded file is controlled in Web. config:
CopyCode The Code is as follows:
Maxrequestlength is the maximum size of the parameter request to control the upload size (in kilobytes ). The default size is 4096 KB (4 MB ).
The following code can achieve this switching effect.
First, let's look at the interface:Interface code:Copy codeThe Code is as follows:
Script code:Copy codeThe Code is as follows: Recipe2
The first click Page has three labels, the second click has six, and the third click has nine labels, that is, each click needs to add three labels in the last status.
My method is to save the last state through Session. One solution is as
To solve this problem, we need to first understand the lifecycle of ASP. NET applications, first look at an image prepared by the author below:
We can clearly see that when a common IIS accesses an application, each time a single page URL is
First, create a class:
Copy codeThe Code is as follows: using System;
Using System. Collections. Generic;
Using System. Linq;
Using System. Web;
Using System. Drawing;
///
/// Summary of Class1
///
Public class Class1: IHttpHandler // call the
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
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
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
Sample Code download: http://zsharedcode.googlecode.com/files/JQueryElementDemo.rar
The content in this article is as follows:
* Preparation* General handler/ashx* Prepare WebService/asmx
If you want to return JSON through ashx or asmx, You need to
Copy codeThe Code is as follows: '''
''' Converts data to a Double number.
'''
'''
'''
'''
Public Shared Function todbl (ByVal Obj As Object) As Double
If Obj Is DBNull. Value Then
Return 0
ElseIf IsNumeric (Obj) = False Then
Return
We can see that Discuz is merged by two drop-down lists. I found some information on the Internet and wrote this small source code. I will share it with you here!
Run the command, as shown in the following figure (the deep black area is not selected,
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
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:
The following describes the main implementation ideas:
1. Access Images
(1) convert the image file to binary and directly store it in SQL server
Copy codeThe Code is as follows: // UploadHelper. cs
///
/// Convert the image into a long binary
///
/
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
Share the paging code of the two methods
1. Use DataReader for paging
Copy codeThe Code is as follows: //
/// PageList for DataReader
///
///
///
///
///
///
///
///
///
Public DataTable PageListReader (string connectionString,
Copy codeThe Code is as follows: using System;
Using System. Data;
Using System. Configuration;
Using System. Collections;
Using System. Web;
Using System. Web. Security;
Using System. Web. UI;
Using System. Web. UI. WebControls;
Using System. Web.
In model:
Copy codeThe Code is as follows: public function item ($ items, $ name ){
$ ReturnValue = '';
Foreach ($ items as $ n => $ item ){
If (isset ($ this-> $ name )){
If ($ n ==$ this-> $ name ){
$ ReturnValue = $ item;
}
}
}
Return $
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