Jack @ ASP.NET

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries for January, 2010

Visual Studio Team Foundation Server 2010 Upgrade Guidance

The guide covers scenarios which may be encountered during and after the upgrade process. It provides examples of most common and potential issues. It covers scenarios related to general Upgrade Process, Work Item Templates, Reports, and Enterprise TFS Management (ETM). Although this guide refers to TFS 2008 scenarios, almost all the concepts apply also to TFS 2005.

Visual Studio ALM Rangers

This guidance is created by the Rangers who have the mission to provide out of band solutions for missing features or guidance. This content was created with support from Microsoft Product Group, Microsoft Most Valued Professionals (MVPs) and technical specialists from technology communities around the globe, giving you a real-world view from the field, where the technology has been tested and used.

What is in the package?
The download package consist of three seperate ZIP files containing a number of quick reference posters and quick reference sheets in XML Paper Specification (XPS) format:

  • Visual Studio 2010 Quick Reference Guidance – Overview (Default Download)
    • An overview of the guidance and focus areas, contained in one index table and overview quick reference poster.
  • Visual Studio 2010 Quick Reference Guidance – Basic Guidance
    • A collection of basic guidance sheets, focusing on the “what” are the key features and “why” to consider them.
  • Visual Studio 2010 Quick Reference Guidance – Supporting Guidance
    • A set of documents and quick reference posters, supporting the basic guidance sheets.

A single document with the seven upgrade scenarios, upgrade related questions and answers. Download your copy today!

Go http://vs2010upgradeguide.codeplex.com 

Keyboard Shortcut Tricks in Visual Studio 2010

  1. visual-studio-2010-asp.net4 Insert a blank line above or below the current line:
    Go to any line in the Editor and press CTRL + Enter to insert a line above or CTRL + SHIFT + Enter to insert a line below the current line.
  2. Pasting a single selection into a box selection
    ALT + Left Mouse
  3. Zoom in or out of text in the Editor using the mouse wheel
    CTRL + Mouse Wheel
  4. Zero-length box selection
    Alt + Left Mouse
    • Assume that you have a a situation with some variables like the ones below and you want to make them all public
    • The answer is a zero-length box selection.  Hold down your ALT key and Left Mouse Button, then drag straight down
    • Release the ALT key and the Left Mouse Button.
    • Done~

jQuery 1.4 Released

In celebration of jQuery’s 4th birthday, the jQuery team is pleased to release the latest major release of the jQuery JavaScript library! A lot of coding, testing, and documenting has gone into this release, and we’re really quite proud of it.

You can feel free to include the above URL directly into your site and you will get the full performance benefits of a quickly-loading jQuery.

With jQuery 1.4 we attempted to minimize any large upgrade hassles – maintaining the signatures of all public functions. That being said, please read through the list of potentially-breaking changes to be aware of what might cause problems in your applications.

Features

Below is an overview of all the changes and functionality added to jQuery 1.4. Additionally all of the changes have been documented in the jQuery 1.4 docs.

And you can go jQuery.com to view the detail

Server Side Validation With ASP.NET MVC

aspnet_mvc When you’re using ASP.NET MVC, there’s no validation controls for you compared to ASP.NET WebForms. It is always important to validate data on the server as well as the client. Back when Dynamic Data was being developed, a set of attributes was created to help tell the Dynamic Data folks about validation and other metadata so they could create smart scaffolds. What this allows you to do is decorate your classes or properties with validation attributes. A project that is available on CodePlex gives you the power to inject this validation into your MVC project. The CodePlex project can be found here. The end results are you can decorate your classes with some of the following attributes to perform server side validation:

  • Required – a required field
  • StringLength – allows you to set the minimum and maximum length of a string
  • RegularExpression – performs regular expression validation

When you use this your validation classes will look like the following example:

Via C#

   1: public class EmployeeMetaData

   2: {

   3: [Required]

   4:       [StringLength(10, ErrorMessage="Given name cannot be more than 10 characters")]

   5:       public string GivenName { get; set; }

   6:  

   7:       [Required]

   8:       public string Surname { get; set; }

   9: }

Via VB

   1: Public Class EmployeeMetaData

   2: Private privateGivenName As String

   3: <Required, StringLength(10, ErrorMessage:="Given name cannot be more than 10 characters")> _

   4: Public Property GivenName() As String

   5:       Get

   6:             Return privateGivenName

   7:       End Get

   8:       Set(ByVal value As String)

   9:             privateGivenName = value

  10:       End Set

  11: End Property

  12:  

  13:        Private privateSurname As String

  14:        <Required> _

  15:        Public Property Surname() As String

  16:              Get

  17:                    Return privateSurname

  18:              End Get

  19:              Set(ByVal value As String)

  20:                    privateSurname = value

  21:              End Set

  22:        End Property

  23: End Class

Secrets of IE8

There are feature in IE8 (some of which are in older Internet Explorers as well) that have been around but never got the attention it deserved. I am going to go threw some of the futures that you may not know about below.

ctrl+Q: See a thumb nail view of all your Tabs ctrl qsimply by hitting control Q on your keyboard (Ctrl+Q). Seeing how most people are visual this will allow you to work quicker and more efficient.

Click on the tab you want or press Control Q again to go back to the tab you were on.

Close the tabs by clicking on the “X” in the upper right hand corner.

Right click to see what other options you can do with the tab.

Full screen: IE8 comes with only a favorites barfull screen and an area for the tabs, however some people like to install different tool bars that may clutter the top of there browser. Hit the “F11” key on your keyboard to toggle the page in and out of full screen.

Move the mouse to the top of the screen to see the rest of the browser the scroll bar is till on the right.

Alt+Tab will move you through windows while Ctrl+Tab will move you through tabs.
Ctrl+W will close your tab while
Ctrl+T will open a new tab.
And of course you can use the above Ctrl+Q to see all your tabs.

.

Improved Zoom: With enhanced resolution and readability, Zoom allows for automatic zoom2 scaling of a page’s content while maintaining the site’s intended layout. You can read very large or very small pages more clearly without having to scroll back and forth.

Press Ctrl+Mouse Role (if your mouse has this ability) to zoom in or out.

If your mouse does not do this Press Ctrl++ and Ctrl+-. (Control and Plus or control and Minus) With this feature and the last who will ever needs glasses anymore.

.

Tab Grouping: Taicon_tabgroupsb Grouping makes it easier to stay organized while browsing multiple webpages. Tabs that are opened from other tabs now have the same visual representation, and you can save time by closing a set of related tabs as a group by simply right-clicking. You also can right-click on a tab to close tab groups, ungroup a single tab, clone a tab, re-open a previously closed tab, or even open a new tab all together.

internet optionHome Tabs: In the morning when you open up your browser instead of opening up one tab with one Web site, open up as many as you want.

Go to the Tools->Internet Options and in the “Home Page” section type in the URL of each site you want to open in a separate tab on a separate line.

Suggeste d Sites: If you love that site, try this one. That’s the idea behind Internet icon_suggestedExplorer 8′s new Suggested Sites feature. At your request, Internet Explorer 8 can use your browsing history to suggest other sites you may like or find useful. It’s another way that Internet Explorer 8 helps you utilize the web to its full potential.

This is a simple WebSlice. Simply click to find out what other things may interest you you.

Smart Address Bar: Internet Explorer 8 helps you find where you icon_smartbarwant to go as you type the address of your desired website.

By using Windows Search for faster performance and a richer return of information, the Smart Address Bar offers useful suggestions from your browsing history, favorites, and feeds.

Type single words into the Smart Address Bar, and they will be matched to simple domain names, making web surfing fast and efficient.

In Private Browsing: Stop worrying about your information beingicon_inprivate stored on a Public computer. With industry-leading security features like InPrivate, you can browse and shop confidently using Internet Explorer 8, wherever you go on the web, knowing you have control over the protection of your personal information. Safety, trust, and reliability has always been IE’s number one concern.

Domain Highlighting: When you visit a site, its domain is highlighted in icon_domainthe Address Bar. This helps alert you to websites that are imposters of trusted sites, This will reduce the chance of compromising your personal information.

Take a look next time and make sure the site you want is the site you are on.

.Cross Site Scripting Filter: Check out the command bar (picture) for all the different Command barsafety  controls you have command over. Stay safer online and help protect yourself from malicious software running on compromised websites with the Cross Site Scripting Filter.

Compatibility View: Are some sites that you are going to looking icon_compatibilityweird, this is because the site you are visiting has not been updated in a while. Now you can easily display websites that were designed for older browsers. Simply press the Compatibility View button if you see display problems on a website like misaligned text, images, or text boxes

Terminal Services Manager Tool

image The Terminal Services Manager tool, Tsadmin.exe, is the main administration tool used to manage existing Terminal Services sessions, users, and processes which are connected to, or running on the Terminal Services server. The Terminal Services Manager tool can be used to manage a single Terminal Services server, or multiple Terminal Services servers. The administrative tasks that can be performed using the Terminal Services Manager tool are listed below:

  • View information on existing Terminal Services servers, users, and any connected or running sessions and processes.
  • Connect to sessions, and disconnect from sessions.
  • Terminate existing sessions and processes
  • Log off users from sessions.
  • Send messages to users and sessions.
  • Monitor users, sessions, and processes

The Actions menu on the Terminal Services Manager window contains various options which enable you to perform different tasks or actions for users, sessions and processes. The Actions menu options, and the permissions required to perform these actions are listed below:

  • Connect: The Connect option can be used only from a session, and it enables a user to connect from a session to a different session. The required permissions is Full Control, or User Access
  • Disconnect: This Action menu option disconnects the user from the existing session. The session is however saved, and applications still continue to run. The required permission is Full Control.
  • Send Message: The Send Message option enables a user to transmit a message to a single session, or to all sessions. The required permission is Full Control, or User Access.
  • Remote Control: This option enables a user to utilize the existing session to examine or control the session of another user. The required permission is Full Control.
  • Reset: This option is used to immediately end a session. All unsaved user data is lost. The required permission is Full Control.
  • Status: This option can be used to display information on a particular session. The required permission is Full Control, or User Access
  • Log Off: The Logoff option can be used to log off a user from a session. The required permission is Full Control.
  • End Process: This option can be used to end a process in a session. The required permission is Full Control.