您的位置:首页 > Web前端 > JQuery

ASP.NET英文技术文章推荐[02/17 - 02/23]:AJAX、History、jQuery、最佳实践、LINQ、Visual Studio、JavaScript、IIS

2008-03-09 11:27 941 查看
摘要

继续推荐。本期共有7篇文章:

产品环境中ASP.NET应用程序的10个最佳实践

ASP.NETAJAXHistory控件使用介绍

在VisualStudio2008中让jQuery支持智能感知

LINQtoJSON测试版

VisualStudio主题风格大收集

在客户端JavaScript脚本中嵌入ASP.NET服务器端变量第二部分

使用VisualStudio2008远程调试IIS中的Web应用程序

 

[1]Top10BestPracticesforProductionASP.NETApplications(产品环境中ASP.NET应用程序的10个最佳实践)

文章介绍了所谓“产品环境中ASP.NET应用程序的10个最佳实践”,不过感觉有些标题党的意味……

Generatenewencryptionkeys

Encryptsensitivesectionsofyourweb.config

UsetrustedSQLconnections

Setretail="true"inyourmachine.config

Createanewapplicationpoolforyoursite

Setthememorylimitforyourapplicationpool

Createandappropriatelyuseanapp_Offline.htmfile

Developarepeatabledeploymentprocessandautomateit

Buildandreferencereleaseversionsofallassemblies

Loadtest

 

[2]ASP.NETAJAXHistoryTutorials(ASP.NETAJAXHistory控件使用介绍)

ASP.NETAJAX最新引入的History控件能够帮助我们在Ajax应用程序中维护页面中的“历史”纪录。这篇文章就详细地介绍了这个History控件的使用方法。

系列中包含了三篇文章:

ASP.NETAJAXHistoryPart1:Server-Side

ASP.NETAJAXHistoryPart2:Client-Side

ASP.NETAJAXHistoryPart3:Server-Side+Client-Side

作者同时还提供了代码下载:quarterbackrater.zip

以及一个在线的DEMO:here

 

[3]JQueryIntelliSenseinVisualStudio2008(在VisualStudio2008中让jQuery支持智能感知)

上一篇的推荐中,曾经介绍过VisualStudio2008对jQuery提供了支持智能感知,当时我还在感叹如果有好心人把VS智能感知所需要的XML注释加上就好了。好在有聪明人用程序实现了这个愿望。

作者的这个工具从jquery-docs-xml.xml中得到XML注释,然后生成了VS能够识别的XML版本,比如:

jQuery=$=function(expr,context){

///<summary>

///1:$(expr,context)-ThisfunctionacceptsastringcontainingaCSSorbasicXPathselectorwhichisthenusedtomatchasetofelements.

///2:$(html)-CreateDOMelementson-the-flyfromtheprovidedStringofrawHTML.

///3:$(elems)-WrapjQueryfunctionalityaroundasingleormultipleDOMElement(s).

///4:$(fn)-Ashorthandfor$(document).

///</summary>

///<returnstype="jQuery"></returns>

///<paramname="expr"/>

///1:expr-Anexpressiontosearchwith

///2:html-AstringofHTMLtocreateonthefly.

///3:elems-DOMelement(s)tobeencapsulatedbyajQueryobject.

///4:fn-ThefunctiontoexecutewhentheDOMisready.

///</param>

///<paramname="context"optional="true"/>

///1:context-(optional)ADOMElement,DocumentorjQuerytouseascontext

///</param>

///<fieldtype="String"name="jquery">ThecurrentversionofjQuery.</field>

///<fieldtype="Number"name="length">Thenumberofelementscurrentlymatched.</field>

};


然后引入,就万事大吉了。

 

[4]LINQtoJSONbeta(LINQtoJSON测试版)

上一篇的推荐中介绍了一个LINQtoJavaScript,是在JavaScript中实现了“类似”Linq的语法。不过这回要介绍的这个LINQtoJSON可是货真价实的LINQProvider。作用就是通过LINQ让JSON字符串能够和对象互相转换。

比如这一段:

List<Post>posts=GetPosts();


JObjectrss=

newJObject(

newJProperty("channel",

newJObject(

newJProperty("title","JamesNewton-King"),

newJProperty("link","http://james.newtonking.com"),

newJProperty("description","JamesNewton-King'sblog."),

newJProperty("item",

newJArray(

frompinposts

orderbyp.Title

selectnewJObject(

newJProperty("title",p.Title),

newJProperty("description",p.Description),

newJProperty("link",p.Link),

newJProperty("category",

newJArray(

fromcinp.Categories

selectnewJValue(c)))))))));


Console.WriteLine(rss.ToString());


生成的JSON如下:

//{

//"channel":{

//"title":"JamesNewton-King",

//"link":"http://james.newtonking.com",

//"description":"JamesNewton-King'sblog.",

//"item":[

//{

//"title":"Json.NET1.3+Newlicense+NowonCodePlex",

//"description":"AnnoucingthereleaseofJson.NET1.3,theMITlicenseandthesourcebeingavailableonCodePlex",

//"link":"http://james.newtonking.com/projects/json-net.aspx",

//"category":[

//"Json.NET",

//"CodePlex"

//]

//},

//{

//"title":"LINQtoJSONbeta",

//"description":"AnnoucingLINQtoJSON",

//"link":"http://james.newtonking.com/projects/json-net.aspx",

//"category":[

//"Json.NET",

//"LINQ"

//]

//}

//]

//}

//}


 

[5]VisualStudioProgrammerThemesGallery(VisualStudio主题风格大收集)

VisualStudio2008支持我们将IDE自定义的设置(包括配色方案、编辑器字体等)导入及导出。这样就有“好事者”收集了一大批这样的风格,先参观两个吧:









 

[6]EmbeddingASP.NETServerVariablesinClientJavaScript,Part2(在客户端JavaScript脚本中嵌入ASP.NET服务器端变量第二部分)

上一篇的推荐中同样介绍过这个东西,不过作者显然是有了一些改进。比如这个就能将某个容器中所有的服务器端控件的ID都添加上:

//***AddallClientIds-notethismaycausenamingconflictsonduplicatenames

//***inseparatenamingcontainers.Firstonewins!

scriptVars.AddClientIds(this,true);


生成了这样一大段:

varserverVars={

"name":"RickStrahl",

"company":"Rick's/"East//West/"Trading",

"entered":newDate(888054678218),

"counter":12.22,

"txtNameValue":"",

"headId":"ctl00_head",

"form1Id":"aspnetForm",

"ContentId":"ctl00_Content",

"txtNameId":"ctl00_Content_txtName",

"btnSubmitId":"ctl00_Content_btnSubmit",

"panel1Id":"ctl00_Content_panel1",

"txtPanelTextBoxId":"ctl00_Content_txtPanelTextBox",

"repListId":"ctl00_Content_repList",

"gdvTestId":"ctl00_Content_gdvTest"

};


类似的新功能还有不少。

 

[7]DebuggingIIS7.0WebapplicationsremotelywithVisualStudio2008(使用VisualStudio2008远程调试IIS中的Web应用程序)

不能不说,VisualStudio和IIS的功能越来越强大了,文章的标题就说明了这个事实……

这篇文章就介绍了用VisualStudio2008远程调试IIS中Web应用程序的方法,感兴趣或是想尝尝鲜的朋友都可以看看 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐