ASP.NET4.5从零开始(1)
使用Web窗体
引言
前段时间客户A突然提出,B项目希望可以做成BS形式的,之前是CS的,因为我之前也没学过ASP.NET,于是一边百度,一边Coding,马马虎虎的把功能流程给调通,然后就交差了,想着闲下来再系统地学习一下ASP.NET。最近,有新接手一个项目,优势设计ASP.NET的,一边写一边百度,写着写着发现首先对于什么时候用服务器控件,什么时候用可编程html元素等细化的东西始终没有清晰的认识,总是挑实现简单的写,结果心里很没有底,终于狠下心来从头认真的学习一下ASP.NET.
开始前的准备
创建Web Form项目
使用ASP.NET EMPTY WEB APPLICATION模板新建一个Visual Studio项目:

在项目上右键-Add-New Item选择Web模板中的Web Form项目,这里会创建3个文件,第一个是Web窗体本身,他的扩展名为Aspx,文件内容如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebForm.Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div> </div>
</form>
</body>
</html>
第二个文件为代码隐藏类,扩展名cs,他默认以与其关联的Web窗体来命名,文件内容如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls; namespace WebForm
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{ }
}
}
最后一个文件为设计器文件,扩展名designer.cs---可视化设计工具需要使用该文件(因为在实际操作中,我们不需要对该文件进行任何修改,因此这里不对其中内容进行贴图)。
代码片段,可编程HTML元素和控件
代码片段指放置在<%与%>标签之间的C#表达式,有各种不同的代码片段可供使用:

以上为Pro ASP.NET 4.5 IN C# 第十二章的截图。
对于标准代码片段<%,内容代码片段<%=,数据绑定代码片段<%#,以及指令由于较为常用,下面只对属性代码片段进行举例说明:
在Web.Config文件中添加配置元素
<?xml version="1.0" encoding="utf-8"?> <!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
--> <configuration>
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
<appSettings>
<add key="title" value="touha's first web form"/>
</appSettings>
</configuration>
修改web窗体文件,读取前面定义的title属性的值:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebForm.Default" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> <asp:Literal ID="Literal1" runat="server" Text="<%$ AppSettings:title%>" /></title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
注意:属性代码片段必须放在Literal控件中,否则将提示如下错误

关于其详细用法,请参考:https://msdn.microsoft.com/zh-cn/library/d5bd1tad(VS.80).aspx
对于可编程HTML元素,这里暂时不做讲解。
控件是属于ASP.NET很大的一块,她是用于生成HTML片段的可重用的功能块,可分为:用户控件,服务器控件以及内置控件,本节不做叙述,后面会对其将会深入讨论之。
aspx web窗体最后究竟会生成怎样一个C#类
查看Windows7 和 Window8 上的c:\Users\<userName>\AppData\Local\Temp\Temporary ASP.NET Files目录(注意AppData默认为隐藏),下面贴出代码:
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.34209
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------ [assembly: System.CodeDom.Compiler.GeneratedCodeAttribute("ASP.NET", "4.0.30319.34274")]
[assembly: System.Security.SecurityRulesAttribute(System.Security.SecurityRuleSet.Level2)]
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5.1")] namespace @__ASP { internal class FastObjectFactory_app_web_yc3poujj { #line 1 "c:\\dummy.txt" #line default
#line hidden private FastObjectFactory_app_web_yc3poujj() {
} static object Create_ASP_default_aspx() {
return new ASP.default_aspx();
}
}
}
#pragma checksum "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "FF4B8FBE55EE3CCAF50519550FD9CA46EAB26B31"
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.34209
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace ASP {
#line 392 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Linq;
#line default
#line hidden
#line 399 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web.Security;
#line default
#line hidden
#line 390 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.ComponentModel.DataAnnotations;
#line default
#line hidden
#line 388 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Collections.Generic;
#line default
#line hidden
#line 394 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Text.RegularExpressions;
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
using System.Web.UI.WebControls;
#line default
#line hidden
#line 405 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Xml.Linq;
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
using System.Web.UI;
#line default
#line hidden
#line 404 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web.UI.HtmlControls;
#line default
#line hidden
#line 395 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web;
#line default
#line hidden
#line 391 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Configuration;
#line default
#line hidden
#line 386 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System;
#line default
#line hidden
#line 393 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Text;
#line default
#line hidden
#line 400 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web.Profile;
#line default
#line hidden
#line 396 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web.Caching;
#line default
#line hidden
#line 387 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Collections;
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
using System.Web.UI.WebControls.WebParts;
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
using System.Web.UI.WebControls.Expressions;
#line default
#line hidden
#line 389 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Collections.Specialized;
#line default
#line hidden
#line 398 "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\web.config"
using System.Web.SessionState;
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
using System.Web.DynamicData;
#line default
#line hidden
using Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms;
[System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
public class default_aspx : global::WebForm.Default, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
protected global::System.Web.UI.WebControls.Literal Literal1;
#line default
#line hidden
private static bool @__initialized;
private static object @__fileDependencies;
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public default_aspx() {
string[] dependencies;
((global::WebForm.Default)(this)).AppRelativeVirtualPath = "~/Default.aspx";
if ((global::ASP.default_aspx.@__initialized == false)) {
dependencies = new string[];
dependencies[] = "~/Default.aspx";
global::ASP.default_aspx.@__fileDependencies = this.GetWrappedFileDependencies(dependencies);
global::ASP.default_aspx.@__initialized = true;
}
this.Server.ScriptTimeout = ;
}
protected System.Web.Profile.DefaultProfile Profile {
get {
return ((System.Web.Profile.DefaultProfile)(this.Context.Profile));
}
}
protected System.Web.HttpApplication ApplicationInstance {
get {
return ((System.Web.HttpApplication)(this.Context.ApplicationInstance));
}
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.LiteralControl @__BuildControl__control2() {
global::System.Web.UI.LiteralControl @__ctrl;
@__ctrl = new global::System.Web.UI.LiteralControl("\r\n\r\n<!DOCTYPE html>\r\n\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , true));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.HtmlControls.HtmlMeta @__BuildControl__control4() {
global::System.Web.UI.HtmlControls.HtmlMeta @__ctrl;
#line 7 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl = new global::System.Web.UI.HtmlControls.HtmlMeta();
#line default
#line hidden
#line 7 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
((System.Web.UI.IAttributeAccessor)(@__ctrl)).SetAttribute("http-equiv", "Content-Type");
#line default
#line hidden
#line 7 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl.Content = "text/html; charset=utf-8";
#line default
#line hidden
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , false));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.LiteralControl @__BuildControl__control6() {
global::System.Web.UI.LiteralControl @__ctrl;
@__ctrl = new global::System.Web.UI.LiteralControl(" ");
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , true));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.WebControls.Literal @__BuildControlLiteral1() {
global::System.Web.UI.WebControls.Literal @__ctrl;
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl = new global::System.Web.UI.WebControls.Literal();
#line default
#line hidden
this.Literal1 = @__ctrl;
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl.ID = "Literal1";
#line default
#line hidden
@__ctrl.Text = global::System.Convert.ToString(System.Web.Compilation.AppSettingsExpressionBuilder.GetAppSetting("title", typeof(System.Web.UI.WebControls.Literal), "Text"), global::System.Globalization.CultureInfo.CurrentCulture);
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , false));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.HtmlControls.HtmlTitle @__BuildControl__control5() {
global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl;
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl = new global::System.Web.UI.HtmlControls.HtmlTitle();
#line default
#line hidden
global::System.Web.UI.LiteralControl @__ctrl1;
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl1 = this.@__BuildControl__control6();
#line default
#line hidden
System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl1);
#line default
#line hidden
global::System.Web.UI.WebControls.Literal @__ctrl2;
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl2 = this.@__BuildControlLiteral1();
#line default
#line hidden
#line 8 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl2);
#line default
#line hidden
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , false));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.HtmlControls.HtmlHead @__BuildControl__control3() {
global::System.Web.UI.HtmlControls.HtmlHead @__ctrl;
#line 6 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl = new global::System.Web.UI.HtmlControls.HtmlHead("head");
#line default
#line hidden
global::System.Web.UI.HtmlControls.HtmlMeta @__ctrl1;
#line 6 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl1 = this.@__BuildControl__control4();
#line default
#line hidden
System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
#line 6 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl1);
#line default
#line hidden
global::System.Web.UI.HtmlControls.HtmlTitle @__ctrl2;
#line 6 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl2 = this.@__BuildControl__control5();
#line default
#line hidden
#line 6 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl2);
#line default
#line hidden
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , false));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.LiteralControl @__BuildControl__control7() {
global::System.Web.UI.LiteralControl @__ctrl;
@__ctrl = new global::System.Web.UI.LiteralControl("\r\n<body>\r\n ");
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , true));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.LiteralControl @__BuildControl__control8() {
global::System.Web.UI.LiteralControl @__ctrl;
@__ctrl = new global::System.Web.UI.LiteralControl("\r\n <div>\r\n </div>\r\n ");
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , true));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.HtmlControls.HtmlForm @__BuildControlform1() {
global::System.Web.UI.HtmlControls.HtmlForm @__ctrl;
#line 11 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl = new global::System.Web.UI.HtmlControls.HtmlForm();
#line default
#line hidden
this.form1 = @__ctrl;
#line 11 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl.ID = "form1";
#line default
#line hidden
global::System.Web.UI.LiteralControl @__ctrl1;
#line 11 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl1 = this.@__BuildControl__control8();
#line default
#line hidden
System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
#line 11 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl1);
#line default
#line hidden
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , false));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private global::System.Web.UI.LiteralControl @__BuildControl__control9() {
global::System.Web.UI.LiteralControl @__ctrl;
@__ctrl = new global::System.Web.UI.LiteralControl("\r\n</body>\r\n</html>\r\n");
@__ctrl.SetTraceData(typeof(Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData), new Microsoft.VisualStudio.Web.PageInspector.Runtime.WebForms.TraceData(, , true));
return @__ctrl;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
private void @__BuildControlTree(default_aspx @__ctrl) {
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
this.InitializeCulture();
#line default
#line hidden
global::System.Web.UI.LiteralControl @__ctrl1;
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl1 = this.@__BuildControl__control2();
#line default
#line hidden
System.Web.UI.IParserAccessor @__parser = ((System.Web.UI.IParserAccessor)(@__ctrl));
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl1);
#line default
#line hidden
global::System.Web.UI.HtmlControls.HtmlHead @__ctrl2;
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl2 = this.@__BuildControl__control3();
#line default
#line hidden
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl2);
#line default
#line hidden
global::System.Web.UI.LiteralControl @__ctrl3;
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl3 = this.@__BuildControl__control7();
#line default
#line hidden
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl3);
#line default
#line hidden
global::System.Web.UI.HtmlControls.HtmlForm @__ctrl4;
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl4 = this.@__BuildControlform1();
#line default
#line hidden
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl4);
#line default
#line hidden
global::System.Web.UI.LiteralControl @__ctrl5;
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__ctrl5 = this.@__BuildControl__control9();
#line default
#line hidden
#line 1 "c:\users\tangbo\documents\visual studio 2012\Projects\WebForm\WebForm\Default.aspx"
@__parser.AddParsedSubObject(@__ctrl5);
#line default
#line hidden
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
protected override void FrameworkInitialize() {
base.FrameworkInitialize();
this.@__BuildControlTree(this);
this.AddWrappedFileDependencies(global::ASP.default_aspx.@__fileDependencies);
this.Request.ValidateInput();
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override int GetTypeHashCode() {
return ;
}
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
public override void ProcessRequest(System.Web.HttpContext context) {
base.ProcessRequest(context);
}
}
}
从上面代码,可以看出,aspx Web窗体文件生成的类实现了IHttpHandler接口,并且继承了其对应的代码隐藏类文件,另外我们之前加的Literal控件也作为其成员

下面的代码,显示了属性代码片段的实际工作原理

通过Page.FrameworkInitialize方法,可以看出,其主要通过@__BuildControlTree方法,初始化控件树。
总结语
本章对于Web窗体,及其工作原理做了一个粗略的介绍。
ASP.NET4.5从零开始(1)的更多相关文章
- ASP.NET MVC 从零开始 - 自动化部署(其二)
这篇文章是从我的 github 博客 http://lxconan.github.io 导入的. 这是这个系列的第五篇了,前四篇请参见: ASP.NET MVC 从零开始 – Create and R ...
- ASP.NET MVC 从零开始 - 请求处理
这篇文章是从我的 github 博客 lxconan.github.io 导入的. 这是这个系列的第三篇了.前两篇文章请参见: ASP.NET MVC 从零开始 - Create and Run AS ...
- ASP.NET MVC 从零开始 - 自动化部署(其一)
本文是从我的 github 博客 http://lxconan.github.io 导入的. 这是这个系列的第四篇了,前三篇请参见: ASP.NET MVC 从零开始 – Create and Run ...
- ASP.NET4.5Web API及非同步程序开发系列(2)
认识ASP.NET WEB API 他的前身为WCF WEB API用于协助WCF支持RestFul.现在集成进ASP.NET,正式更名为ASP.NET WEB API,ASP.NET Web API ...
- 转:通过代码理解Asp.net4中的几种ClientIDMode设置.
转:http://www.cnblogs.com/xray2005/archive/2011/07/05/2097881.html 以前我们可以通过ClientID在JavaScript脚本中服务器端 ...
- ASP.NET4.0新特性
原文:ASP.NET4.0新特性 在以前试用VS2010的时候已经关注到它在Web开发支持上的一些变化了,为此我还专门做了一个ppt,当初是计划在4月12日那天讲的,结果因为莫名其妙的原因导致没有语音 ...
- ASP.NET4.5Web API及非同步程序开发系列3
ASP.NET4.5Web API及非同步程序开发系列(3) 接着上一篇博客的内容做一个补充,正好是一个大哥提出来的,我们看看一个有趣的现象. 请求相关问题的补充: 我们先在Controller中的定 ...
- ASP.NET4.5Web API及非同步程序开发系列
ASP.NET4.5Web API及非同步程序开发系列 认识ASP.NET WEB API 他的前身为WCF WEB API用于协助WCF支持RestFul.现在集成进ASP.NET,正式更名为ASP ...
- VS2012打开项目 提示Asp.net4.5未在web服务器上注册
在用vs2012代开项目时,没回都显示Asp.net4.5未在web服务器上注册,最后是由于没有下载一个补丁的原因,只需要下载安装补丁 VS11-KB3002339.exe ,下载地址:https:/ ...
随机推荐
- js小知识归纳(待续)
1.javascript 中 if (window != top) top.location.href = location.href;的意思 如果当前窗口不是最上层窗口(比如是在Iframe中),那 ...
- Sublime配置与各种插件
Sublime Text 3 安装Package Control 点击View -> Show Console 在下方命令行内,输入以下命令. import urllib.request,os; ...
- React 高级指南小记
接上篇,还是笔记,还是干货. 深入 JSX 如果使用 JSX 表达式 <Foo />,Foo 必须在范围内,因为这些标签被编译为对指定变量的直接引用. 由于 JSX 编译为对 React. ...
- 75篇关于Tomcat源码和机制的文章
75篇关于Tomcat源码和机制的文章 标签: tomcat源码机制 2016-12-30 16:00 10083人阅读 评论(1) 收藏 举报 分类: tomcat内核(82) 版权声明:本文为 ...
- oracle中trim,ltrim,rtrim函数用法
该函数共有两种作用:第一种,即大家都比较熟悉的去除空格.例子:--TRIM去除指定字符的前后空格SQL> SELECT TRIM(' dd df ') FROM dual;TRIM('DDDF' ...
- VERY DEEP CONVOLUTIONAL NETWORKS FOR LARGE-SCALE IMAGE RECOGNITION 这篇论文
由Andrew Zisserman 教授主导的 VGG 的 ILSVRC 的大赛中的卷积神经网络取得了很好的成绩,这篇文章详细说明了网络相关事宜. 文章主要干了点什么事呢?它就是在在用卷积神经网络下, ...
- 生成多sitemap文件
Thinkphp生成多sitemap文件 我们知道sitemap对于seo的重要性,很多介绍只生成一个文件sitemap.xml ,但是如果网站内容比较多,就要生成多个sitemap文件,因为搜索引擎 ...
- ROS学习笔记(六)——创建、编译包
$ cd ~/catkin_ws #如果新开一个终端,就需要先吧ROS的工作空间配置好 $ source devel/setup.bash #工作空间的环境配置 #正式开始创建包 $ catkin_c ...
- 7 -- Spring的基本用法 -- 4...
7.4 使用 Spring 容器 Spring 有两个核心接口:BeanFactory 和 ApplicationContext,其中ApplicationContext 是 BeanFactory ...
- javascript中this指针
看完此片文章豁然开朗,非常感谢.javascript技术难点(三)之this.new.apply和call详解 下面说一说自己的理解: this指针总是指向调用他的对象,其实我更愿意理解为:this指 ...