使用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)的更多相关文章

  1. ASP.NET MVC 从零开始 - 自动化部署(其二)

    这篇文章是从我的 github 博客 http://lxconan.github.io 导入的. 这是这个系列的第五篇了,前四篇请参见: ASP.NET MVC 从零开始 – Create and R ...

  2. ASP.NET MVC 从零开始 - 请求处理

    这篇文章是从我的 github 博客 lxconan.github.io 导入的. 这是这个系列的第三篇了.前两篇文章请参见: ASP.NET MVC 从零开始 - Create and Run AS ...

  3. ASP.NET MVC 从零开始 - 自动化部署(其一)

    本文是从我的 github 博客 http://lxconan.github.io 导入的. 这是这个系列的第四篇了,前三篇请参见: ASP.NET MVC 从零开始 – Create and Run ...

  4. ASP.NET4.5Web API及非同步程序开发系列(2)

    认识ASP.NET WEB API 他的前身为WCF WEB API用于协助WCF支持RestFul.现在集成进ASP.NET,正式更名为ASP.NET WEB API,ASP.NET Web API ...

  5. 转:通过代码理解Asp.net4中的几种ClientIDMode设置.

    转:http://www.cnblogs.com/xray2005/archive/2011/07/05/2097881.html 以前我们可以通过ClientID在JavaScript脚本中服务器端 ...

  6. ASP.NET4.0新特性

    原文:ASP.NET4.0新特性 在以前试用VS2010的时候已经关注到它在Web开发支持上的一些变化了,为此我还专门做了一个ppt,当初是计划在4月12日那天讲的,结果因为莫名其妙的原因导致没有语音 ...

  7. ASP.NET4.5Web API及非同步程序开发系列3

    ASP.NET4.5Web API及非同步程序开发系列(3) 接着上一篇博客的内容做一个补充,正好是一个大哥提出来的,我们看看一个有趣的现象. 请求相关问题的补充: 我们先在Controller中的定 ...

  8. ASP.NET4.5Web API及非同步程序开发系列

    ASP.NET4.5Web API及非同步程序开发系列 认识ASP.NET WEB API 他的前身为WCF WEB API用于协助WCF支持RestFul.现在集成进ASP.NET,正式更名为ASP ...

  9. VS2012打开项目 提示Asp.net4.5未在web服务器上注册

    在用vs2012代开项目时,没回都显示Asp.net4.5未在web服务器上注册,最后是由于没有下载一个补丁的原因,只需要下载安装补丁 VS11-KB3002339.exe ,下载地址:https:/ ...

随机推荐

  1. Linux解读

    Linux中权限(r.w.x)对于目录与文件的意义 一.权限对于目录的意义 1.首先要明白的是目录主要的内容是记录文件名列表和子目录列表,而不是实际存放数据的地方. 2.r权限:拥有此权限表示可以读取 ...

  2. LINQ之路 7:子查询、创建策略和数据转换

    在前面的系列中,我们已经讨论了LINQ简单查询的大部分特性,了解了LINQ的支持计术和语法形式.至此,我们应该可以创建出大部分相对简单的LINQ查询.在本篇中,除了对前面的知识做个简单的总结,还会介绍 ...

  3. [地图SkyLine二次开发]框架(3)

    上节将显示我们地图的OBJECT控件,布了一下局,但地图没有进行加载. 这是因为我们要在另一个页面,对OBJECT控件进行地图加载,并且得到该控件的sgworld,以便对其进行我们想要的开发. 这里, ...

  4. 24. Swap Nodes in Pairs

    24. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For ...

  5. 02.JavaScript 面向对象精要--函数

    在JavaScript中,函数其实也是对象.是函数不同于其他对象的特点是:函数存在一个被称为[[Call]]的内部属性.[[Call]]属性是函数独有的,表明该对象可以被执行.ECMAScript 定 ...

  6. jquery.nicescroll完美滚动条使用方法

    配置参数 当调用"niceScroll"你可以传递一些参数来定制视觉方面: cursorcolor - 十六进制改变光标颜色,默认值是"#000000" cur ...

  7. centos下安装yaf框架

    安装好php环境之后 安装扩展包 $yum install php-devel /usr/bin/ 就会出现phpize工具包 下载yaf-2.2.8.gz源文件,解压后,进入源文件 phpize [ ...

  8. linux rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpm

    linux rpm 安装mysql异常: [root@localhost upload]# rpm -ivh MySQL-server-5.5.31-2.el6.i686.rpmerror: Fail ...

  9. swiper横向轮播--3d

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  10. sqlite字段属性删除方法

    Sqlite 不支持直接修改字段的名称. 我们可以使用别的方法来实现修改字段名. 1.修改原表的名称 ALTER TABLE table RENAME TO tableOld; 2.新建修改字段后的表 ...