摘要
繼續推薦。本期共有7篇文章:
- 產品環境中ASP.NET應用程式的10個最佳實務
- ASP.NET AJAX History控制項使用介紹
- 在Visual Studio 2008中讓jQuery支援智能感知
- LINQ to JSON測試版
- Visual Studio主題風格大收集
- 在用戶端JavaScript指令碼中嵌入ASP.NET伺服器端變數 第二部分
- 使用Visual Studio 2008遠端偵錯IIS中的Web應用程式
[1] Top 10 Best Practices for Production ASP.NET Applications (產品環境中ASP.NET應用程式的10個最佳實務)
文章介紹了所謂“產品環境中ASP.NET應用程式的10個最佳實務”,不過感覺有些標題黨的意味……
- Generate new encryption keys
- Encrypt sensitive sections of your web.config
- Use trusted SQL connections
- Set retail="true" in your machine.config
- Create a new application pool for your site
- Set the memory limit for your application pool
- Create and appropriately use an app_Offline.htm file
- Develop a repeatable deployment process and automate it
- Build and reference release versions of all assemblies
- Load test
[2] ASP.NET AJAX History Tutorials (ASP.NET AJAX History控制項使用介紹)
ASP.NET AJAX最新引入的History控制項能夠協助我們在Ajax應用程式中維護頁面中的“曆史”紀錄。這篇文章就詳細地介紹了這個History控制項的使用方法。
系列中包含了三篇文章:
- ASP.NET AJAX History Part 1: Server-Side
- ASP.NET AJAX History Part 2: Client-Side
- ASP.NET AJAX History Part 3: Server-Side + Client-Side
作者同時還提供了代碼下載:quarterbackrater.zip
以及一個線上的DEMO:here
[3] JQuery IntelliSense in Visual Studio 2008(在Visual Studio 2008中讓jQuery支援智能感知)
在上一篇的推薦中,曾經介紹過Visual Studio 2008對jQuery提供了支援智能感知,當時我還在感歎如果有好心人把VS智能感知所需要的XML注釋加上就好了。好在有聰明人用程式實現了這個願望。
作者的這個工具從jquery-docs-xml.xml中得到XML注釋,然後產生了VS能夠識別的XML版本,比如:
jQuery = $ = function (expr, context) {
/// <summary>
/// 1: $(expr, context) - This function accepts a string containing a CSS or basic XPath selector which is then used to match a set of elements.
/// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML.
/// 3: $(elems) - Wrap jQuery functionality around a single or multiple DOM Element(s).
/// 4: $(fn) - A shorthand for $(document).
/// </summary>
/// <returns type="jQuery"></returns>
/// <param name="expr" />
/// 1: expr - An expression to search with
/// 2: html - A string of HTML to create on the fly.
/// 3: elems - DOM element(s) to be encapsulated by a jQuery object.
/// 4: fn - The function to execute when the DOM is ready.
/// </param>
/// <param name="context" optional="true" />
/// 1: context - (optional) A DOM Element, Document or jQuery to use as context
/// </param>
/// <field type="String" name="jquery">The current version of jQuery.</field>
/// <field type="Number" name="length">The number of elements currently matched.</field>
};
然後引入,就萬事大吉了。
[4] LINQ to JSON beta (LINQ to JSON測試版)
在上一篇的推薦中介紹了一個LINQ to JavaScript,是在JavaScript中實現了“類似”Linq的文法。不過這回要介紹的這個LINQ to JSON可是貨真價實的LINQ Provider。作用就是通過LINQ讓JSON字串能夠和對象互相轉換。
比如這一段:
List<Post> posts = GetPosts();
JObject rss =
new JObject(
new JProperty("channel",
new JObject(
new JProperty("title", "James Newton-King"),
new JProperty("link", "http://james.newtonking.com"),
new JProperty("description", "James Newton-King's blog."),
new JProperty("item",
new JArray(
from p in posts
orderby p.Title
select new JObject(
new JProperty("title", p.Title),
new JProperty("description", p.Description),
new JProperty("link", p.Link),
new JProperty("category",
new JArray(
from c in p.Categories
select new JValue(c)))))))));
Console.WriteLine(rss.ToString());
產生的JSON如下:
//{
// "channel": {
// "title": "James Newton-King",
// "link": "http://james.newtonking.com",
// "description": "James Newton-King's blog.",
// "item": [
// {
// "title": "Json.NET 1.3 + New license + Now on CodePlex",
// "description": "Annoucing the release of Json.NET 1.3, the MIT license and the source being available on CodePlex",
// "link": "http://james.newtonking.com/projects/json-net.aspx",
// "category": [
// "Json.NET",
// "CodePlex"
// ]
// },
// {
// "title": "LINQ to JSON beta",
// "description": "Annoucing LINQ to JSON",
// "link": "http://james.newtonking.com/projects/json-net.aspx",
// "category": [
// "Json.NET",
// "LINQ"
// ]
// }
// ]
// }
//}
[5] Visual Studio Programmer Themes Gallery (Visual Studio主題風格大收集)
Visual Studio 2008支援我們將IDE自訂的設定(包括色彩配置、編輯器字型等)匯入及匯出。這樣就有“好事者”收集了一大批這樣的風格,先參觀兩個吧:
[6] Embedding ASP.NET Server Variables in Client JavaScript, Part 2 (在用戶端JavaScript指令碼中嵌入ASP.NET伺服器端變數 第二部分)
在上一篇的推薦中同樣介紹過這個東西,不過作者顯然是有了一些改進。比如這個就能將某個容器中所有的伺服器端控制項的ID都添加上:
// *** Add all Client Ids - note this may cause naming conflicts on duplicate names
// *** in separate naming containers. First one wins!
scriptVars.AddClientIds(this,true);
產生了這樣一大段:
var serverVars = {
"name": "Rick Strahl",
"company": "Rick's \"East\\West\" Trading",
"entered": new Date(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] Debugging IIS 7.0 Web applications remotely with Visual Studio 2008 (使用Visual Studio 2008遠端偵錯IIS中的Web應用程式)
不能不說,Visual Studio和IIS的功能越來越強大了,文章的標題就說明了這個事實……
這篇文章就介紹了用Visual Studio 2008遠端偵錯IIS中Web應用程式的方法,感興趣或是想嘗嘗鮮的朋友都可以看看。