易截截图软件、单文件、免安装、纯绿色、仅160KB

How postback works in ASP.NET

Introduction
In this article, we will take a closer look at how ASP.NET pages post back to themselves, and how to customize this feature in our web applications.
function __doPostBack(eventTarget, eventArgument)
One of the most important features of the ASP.NET environment is the ability to declare controls that run on the server, and post back to the same page. Remember the days of classic ASP? We would create a form which would accept the user's input, and then we would most probably have to create another page that would accept all those inputs, either through HTTP GET or POST, and perform some kind of validation, display and action. Sometimes, even a third page was necessary to perform our actions. This wasted a lot of time and complicated things when you had to make a change. But of course, this is not necessary any more with ASP.NET. There is no need to create second pages that accept the inputs of the first, process them and so on. Form fields and other controls can be declared to run on the server, and the server simply posts the page back to itself and performs all the validation, display and actions. Our life as web developers has become a million times better. But how exactly is this done?
When a control is declared to run on the server, a VIEWSTATE is created which remembers the ID of that control, and the method to call when an action is performed. For example, let's say we input this HTML on a page:
1
<script language="VB" runat="server">
2
Sub Test_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
3
    'enter your code to perform
4
End Sub
5
</script>
6
<html>
7
<body>
8
    <form runat="server" id="myForm">
9
        <asp:linkbutton id="Test" runat="server" text="Create Text file" onclick="Test_Click" />
10
    </form>
11
</body>
12
</html>
&n


相关文档:

一个简单的ASP.NET +ACCESS 登录

首页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head ......

ASP.NET 2.0中的ICallbackEventHandler说明

AJAX技术所提倡的无刷新回调,在原来的技术中需要写大量的JavaScript代码或使用一些AJAX框架,使得开发效率和可维护性大大降低。其实ASP.NET2.0中,已经提供了这样的接口,这就是ICallbackEventHandler。
ICallbackEventHandler存在于System.Web.UI中,我们先做一个非常简单的例子来试用一下。
   第一步,在VS2005中建 ......

代码编写规范说明书(c#.net与asp.net)

1   目的
2   范围
3   注释规范
3.1   概述
3.2   自建代码文件注释
3.3   模块(类)注释
3.4   类属性注释
3.5   方法注释
3.6   代码间注释
4   ......

Asp.Net前台调用后台变量

1. Asp.Net中几种相似的标记符号: < %=...%>< %#... %>< % %>< %@ %>解释及用法
答: < %#... %>: 是在绑定控件DataBind()方法执行时被执行,用于数据绑定
如: < %# Container.DataItem("tit") %>
< %= %>: 在程序执行时被调用,可以显示后台变量值
如:
*.aspx中: < %= ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号