Showing posts with label Visual Studio 2005. Show all posts
Showing posts with label Visual Studio 2005. Show all posts

Tuesday, October 28, 2008

Essential Visual Studio Tips & Tricks that Every Developer Should Know

Found this great post on Stephen Walther's blog.

tip 1: don't need to select a line to copy or delete it

If you want to copy a line of code then you can simply press CTRL-c to copy the line and press CTRL-v to paste the line. If you want to delete a line, don’t select it first, just press CTRL-x. You’ll be surprised how much time this one tip will save you.

tip 3: Never create properties by hand

just type prop + TAB + TAB. When you type prop + TAB + TAB, you get a code snippet (template) for entering a property. Use TAB to move between the template parameters. Press the ENTER key when you are finished creating the propert.

I found these two are most useful and time saving for me. Others are at: http://weblogs.asp.net/stephenwalther/archive/2008/10/21/essential-visual-studio-tips-amp-tricks-that-every-developer-should-know.aspx

Wednesday, July 16, 2008

Debug javascript inside VS2005

writing JavaScript functions in the asp.net is not an easy task specially lacking the debugging feature in VS2005 (VS2008 has this build in). However, there is an easy way to enable debugging feature in the VS2005.

1. uncheck the "disabling scripting debug" in the IE internet option.
2. add "debugger;" in the script block to enable javascript debugging.

for more detail, click here

Monday, June 16, 2008

Debug with FireFox in Visual Studio 2005

There are times when we need to make sure that our code not only works with IE, but also with other popular web browsers, such as FireFox.

Here are the steps to do this:
1. Right click the aspx page;
2. Select "browser with" option;
3. In the pop up dialog box, select "add" to add a broswer. Find and point to firefox.exe
4. Click the "Set as Default" button.

Thursday, May 29, 2008

Custom formatting HTML in Visual Studio 2005

Sometimes the aspx source file(html) can be very hard to read. Luckly, the VS2005 included build in format html tool. Just select the portion of the aspx source page, right click the mouse, and choose the "format selection". The aspx source file will look much better with consistent indenting.

For more details, please visit Scott Guthrie's blog

Thursday, April 10, 2008

Web Application Projects vs Web Site Projects

Maor David had a great post on Web Application Projects vs Web Site Projects. Details is here: http://maordavid.blogspot.com/2007/06/aspnet-20-web-site-vs-web-application.html

There is also a great MSDN article on this: http://msdn2.microsoft.com/en-us/library/aa730880(VS.80).aspx. Scroll down to the section "Comparing Web Site Projects and Web Application Projects".

In addition to the articles above, one thing I dislike the web site project is VS always put the solution file (.sln) is inside the My documents folder. I like to put the solution file in the same folder as the web site in. Here is the simple work around to do this:
  1. Create a blank solution file first (file -> new project -> other project types -> virtual studio solutions -> blank solution).
  2. Add the website in the solution (right click the blank solution -> Add new website).

Monday, March 31, 2008

Remove Source Control Binding on Visual Studio 2005

Source control in VS2005 is great. However, there are times when you want to unbind the projects from the Source control (wanted to write some test code, but don't want to check the code out). I used to do it manually by searching the .vss in the project directory and then, manually edit the solution file or the project files. It works, but it's painful.

The correct way to do it is listed below and I hope it will save you time in the future.

1. Open the project/solution in the VS2005.
2. Click File -> Source Control -> Change Source Control.
3. The Change Source Control window will pop up. You can see all the binding information from here.
4. Select all the projects you don't want to bind to the source safe and click the unbind button.
5. A confirmation dialog box will pop up. Click OK to unbind your project/solution from the source safe.

This will safely removing the binding between your project and the source safe.