Reverseajax Reverse Ajax is a Web implementation pattern designed to transfer logical control to the server
What is the transfer of control rights
Traditional Ajax calls are typically triggered by client behavior, such as obtaining zone data,
First build a class:
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Drawing;
Summary description of Class1
public class Class1:ihttphandler//Calling
The other day I ran into the situation where I submitted my form with Ajax and then sent the message. The following two functions are then written to solve the two problems.
The first function turns the data in HTML into an HTML entity, and the
First look at the code snippet below, we want the user to click on the button on the page to first submit the data to the specified third party page, and then perform the background of the Page_Load event.
Copy Code code as follows:
Where to control the size of uploaded files in web.config:
Copy Code code as follows:
maxRequestLength is the maximum size (in kilobytes) of the request to control the upload size. The default size is 4096 KB (4 MB).
STEP.1: Create file CustomHandler.cs, code as follows:
Copy Code code as follows:
Using System;
Using System.Web;
Namespace customhandler{
public class jpghandler:ihttphandler{
public void ProcessRequest (HttpContext
1. Start the restore below first look at the original paging stored procedures.
Copy Code code as follows:
ALTER PROCEDURE [dbo]. [Sp_sql_paging]
(
@SqlDataTable NVARCHAR (4000),--table name
@PrimaryKey NVARCHAR (4000),--primary Key
Create a new solution: API
Add Class Library Api.data
Api.data a new Entity
Copy Code code as follows:
public class Entity
{
private int id;
public int Id
{
get {return ID;}
set {id = value;}
}
private string name;
1. The event code is first in the Page_Load of the ASPX file in the background verification code:
Copy Code code as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Web;
Using System.Web.UI;
Workaround 1:
DataList DataBind ()
Workaround 2:
View detailed information on MSDN
Workaround 3:
Use a table table in the DataList template, such as:
Copy Code code as follows:
Database binding to DataList controls
Copy Code code as follows:
Using System.Collections.Generic;
Using System.Web;
Using System;
Namespace DataAccess
{
Cache Control class
public class CacheControl
{
public static list Allusecachekey = new list ();
Add cache
The method is as follows:
1, the page dragged into the ScriptManager. To facilitate the use of Ajax scripts. Placed at the same time in other client controls, used to trigger the Netpost method. Client controls are not listed here.
Copy
Some time ago to see a master in the garden wrote a pure Css+js effect, I put it and asp.net validation control, with this master write effect as asp.net difficult to control the hint effect. The following figure
and previously written more
Here, I'll introduce you to the two modal dialogs that I do.
Method OneThis method is an extended control using asp.net ajax: asp.net the ModalPopupExtender control in the AJAX controls Tool Kit:First, we first create a asp.net page:
Copy Code code as follows:
Class ExchangeRate
{
Private Const string _baseurl = "web address";
Public Const string CurrencyCode = "currency type with ' | ' Separate ";//currency type
Public Hashtable GetValues ()
{
Hashtable Htreturn
The first reflection is whether these properties of the validation code can be set (that is, encapsulated into a class, then to expose the public properties and methods to use, or directly in the general process to achieve the validation code
Here's the code:
Allow only user name input: User name must begin with 0~9, a~z or A~z!
Copy Code code as follows:
protected void Button3_Click (object sender, EventArgs e)
{
int error_count = 0; Legality used to identify the user
(1) First we create an MVC project, of course, preferably the mvc1.0 version.
(2) My demo, no reconfiguration routing resolution, using the default routing resolution address of the MVC project. Of course, if anyone is interested, you can
1, get the ASPX client request address:
Copy Code code as follows:
' > Address
2. C # calls the Client method: (top.window.document: Table parent form, if mainframe object is in this form, no top.window.document)
JS in
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