分类目录归档:Visual Studio

有关Visual Studio2005、Visual Studio2008、Visual Studio2010的文章

web developer tips (26):在 App_Code目录下同时放c#和VB.NET文件

原文地址:How to have C# and VB.NET files inside your App_Co […]


原文地址:How to have C# and VB.NET files inside your App_Code directory 如果你利用App_Code目录来开发一个Asp.net web网站,有时候需要写用不同net语言的代码文件。例如,如果你想用在同一个web网站同时使用c#和VB.net ...... [阅读全文]

web developer tips (25):在iis7下规范URLs和重定向

原文地址:You can have canonical URLs and Redirects with IIS […]


原文地址:You can have canonical URLs and Redirects with IIS 7.0 规范的URLs 有利于搜索引擎优化(Search Engine Optimized,SEO),人可以很容易理解 http://www.contoso.com 和http://contoso.com 是一样的。但是,许多的搜索引擎不会做这样的假设,会把它们作为两个分开的条目来对待。这样讲对它们进行等级区分,同时降低网站的整体相关性。 在iis7里面,你可以通过地址重写(URL Rewrite )来解决这个问题。在web.config里加入如下规则,所有用户访问http://contoso.com将会自动跳转到http://www.contoso.com <configuration> <system.webServer> <rewrite> <rul...... [阅读全文]

web developer tips (24):显示html/css的警告错误或错误

原文地址:You could display CSS/HTML errors as warnings or a […]


原文地址:You could display CSS/HTML errors as warnings or as errors 在vs2008里面可以有个很cool的功能,可以降级显示作为任何警告的错误,这个功能很有用,它可以让你区分验证的错误和查找让程序无法生成的错误。 http://www.watch-life.net/life-thinking/display-css-html-errors-as-warnings-or-as-errors.html 在vs2008里面,默认会如下图所示显示任何html/css 的作为警告的错误。注意警告有个绿色的波浪线。 ...... [阅读全文]

web developer tips (23):两次单击启动编辑器的格式对话框

原文地址:How to launch Formatting options dialog for editor […]


原文地址:How to launch Formatting options dialog for editor with 2 clicks 通常的情况下,我们可以使用菜单:工具+选项+文本编辑器+html+格式,就可以打开如下图所示的格式设置对话框。 你也可以通过在编辑器里的两次单击来打开这个设置对话框:在编辑器里右键单击,在上下文菜单中选择“格式设置与验证”项. ...... [阅读全文]

web developer tips (22):提高页面和服务器控件加载速度

原文地址:How to improve performance of Page and Server Cont […]


原文地址:How to improve performance of Page and Server Control Processing 1、避免不必要的客户端和服务器间的往返,你可以使用ASP.NET Ajax和局部页面呈现(Partial Page Rendering)。 ASP.NET Ajax:ASP.NET Ajax 允许开发者在创建一个asp.netweb应用的时候,更新数据不要重新加载整个页面。 局部页面呈现(Partial Page Rendering):局部页面呈现(Partial-page rendering)依赖 ASP.NET 的服务控件...... [阅读全文]

web developer tips (21):为Developer Web Server设定固定端口

原文地址:How to set a fixed port for the Developer Web Serv […]


原文地址:How to set a fixed port for the Developer Web Server 当创建一个网站项目的时候,Visual Studio 的开发web服务器(Developer Web Server)会激活本地端口用来运行web网站,默认的情况下,这个端口值是一个可用的随机动态端口,在某些情况下,你也许想web服务器使用固定的端口,可以进行如下配置: http://www.watch-life.net/visual-studio/set-a-fixed-port-for-the-developer-web-server.html 1、如果没有打开Visual Studio的属性窗口,可以使用F4或菜单:视图+属性窗口,打开属性窗口。 2、在解决方案管理器中,左键选中web网站项目 3、...... [阅读全文]

web developer tips (20):使用IIS作为web服务器

原文地址:How to change WAP to use an IIS Web server 有时候,在开发 […]


原文地址:How to change WAP to use an IIS Web server 有时候,在开发web应用,想使用IIS来代替Visual Studio 开发服务器(Development Server) 作为web应用服务器,可以按如下操作进行: http://www.watch-life.net/visual-studio/change-wap-to-use-an-iis-web-server.html 1、在解决方案管理器中,单击“ Properties”页或在项目的上下文菜单中选择“属性” ...... [阅读全文]

web developer tips (19):设置默认视图为设计视图

原文地址:How to set the default view to Design view 在 Visua […]


原文地址:How to set the default view to Design view 在 Visual Studio 2008的编辑一个web页面的时候,“源视图”(Source View),你可以自定义设计视图(Design View)为默认视图。 http://www.watch-life.net/visual-studio/set-the-default-view-to-design-view.html 菜单:工具+选项+html设计器+常规,在“起始位置”选项中,选中“设计视图”,如下图所示: 快捷键Shift+...... [阅读全文]

web developer tips (18):从工具箱粘贴或拖拽控件时进行绝对定位

原文地址:How to absolute position controls on copy paste or […]


原文地址:How to absolute position controls on copy paste or drag drop from Toolbox 在设计器里为了让任何任一控件进行绝对定位,你需要选中控件,然后选择如下菜单:格式+设置位置+绝对。 有时候,你也许想从工具箱拖拽控件或在设计器里剪贴控件后就让控件被绝对定位。你可以这样做: http://www.watch-life.net/life-thinking/absolute-position-controls-on-copy-paste-or-drag-drop-from-toolbox.html 菜单:工具+选项+html设计器+css样式,选中“对于使用工具箱、粘贴或拖放控件时,将定位更改为绝对定位”。 ...... [阅读全文]

web developer tips (17):远程调试使用IIS的web应用

原文地址:How to remote debug WAPs that are using IIS 如果你有个使 […]


原文地址:How to remote debug WAPs that are using IIS 如果你有个使用iisweb应用发布在另一台服务器,你可以使用 Visual Studio 2008 SP1来远程调试这个web应用。 http://www.watch-life.net/visual-studio/remote-debugging-waps-using-iis.html 首先通过菜单:文件+打开项目,打开(远程)服务器(比如 \\server\share)的web应用项目,右键单击“项目”选择“属性”,打开“web”标签页。在“服务器”选项里,选中“使用自定义web服务...... [阅读全文]

web developer tips (16):变更CSS编辑器的默认格式设置

原文地址:change the default format settings for CSS Editor […]


原文地址:change the default format settings for CSS Editor 菜单:工具+选项+文本编辑器+css+格式。 这个对话框给出了三种css书写格式,你可以根据自己的需要灵活选择: http://www.watch-life.net/visual-studio/change-the-default-format-settings-for-css-editor.html 紧凑模式(Compact rules):选择这个选项后,属性会被放在一行,如下所示: &...... [阅读全文]

web developer tips (15):在ASP.NET Ajax里使用跟踪

原文地址: How to use tracing with ASP.NET Ajax 如果你在使用ASP.NE […]


原文地址: How to use tracing with ASP.NET Ajax 如果你在使用ASP.NET Ajax的时候,遇到一个页面问题,想在调试时候跟踪语句,有个比较快速的方法:使用“Sys.Debug.trace”函数。 <script language="javascript" type="text/javascript"> function PositionDiv() { Sys.Debug.trace("Entering PositionDiv Function"); //some other code Sys.Debug.trace("Exiting PositionDiv Function"); } </script> http://www.watch-life.net/visual-studio/use-tracing-with-asp-net-ajax.html 为了看...... [阅读全文]

web developer tips (14):启动网站调试

原文地址:How to enable debugging of your Web Site 在debug的模式 […]


原文地址:How to enable debugging of your Web Site 在debug的模式配置下运行一个页面,你必须选择菜单:调试+开始启动 或按下F5. 在默认的情况下,调试是没有启用的。如果你想启动调试网站项目,就需要进行配置。这个设置通过修改web.config文件来实现。 默认情况下,在web.config 的compilation节点 的debug 选项设置值是false。 http://www.watch-life.net/visual-studio/enable-debugging-of-your-web-site.html <compilation debug="false" strict="false" ex...... [阅读全文]

web developer tips (13):用ASP.NET Ajax获取浏览器的agent

原文地址:How to get the browser agent using ASP.NET Ajax 当编 […]


原文地址:How to get the browser agent using ASP.NET Ajax 当编写一个web应用的时候,很多时候,针对不同的浏览器做不同的页面请求,ASP.NET Ajax 有个简单的办法通过 Sys.Browser来获取浏览器对象。 http://www.watch-life.net/visual-studio/get-the-browser-agent-using-asp-net-ajax.html 例如,想针对Opera浏览器做一些不同的页面请求,下面的代码块显示可以如何: <script language="javascript&q...... [阅读全文]

web developer tips (12):在Visual Web Developer里创建IIS虚拟目录

原文地址:How to create an IIS Virtual Directory from within […]


原文地址:How to create an IIS Virtual Directory from within Visual Web Developer 以下的步骤介绍如何在Visual Web Developer里创建IIS的虚拟目录(Virtual Directory)。当然,IIS已经被安装。 http://www.watch-life.net/visual-studio/create-an-iis-virtual-directory-from-within-visual-web-developer.html 1、创建一个“网站项目”:文件+新建+网站 2、在“新建网站”对话框里,单击“浏览”按钮,打开“选择位置”对话框 ...... [阅读全文]