Its very simple, free and SEO Friendly. Submit Now....
Saturday, June 13, 2009
Using the Silverlight Accordion Control
LINQ to SQL and ADO.NET Data Services: Working Together
Url Rebasing in ASP.NET 2.0
Using ASP.NET 3.5's ListView and DataPager Controls: Editing Data
The GridView and DetailsView controls offer built-in editing functionality that can be turned on with the tick of a checkbox. Without writing a line of declarative markup or server-side source code, the page developer gets a decent out of the box editing interface. Namely, each field in the GridView or DetailsView is rendered in its editing interface; BoundFields display a TextBox control while CheckBoxFields display an enabled checkbox. Moreover, a CommandField is added, which displays t...Full Article.
What does the optimize switch do?
I was asked recently exactly what optimizations the C# compiler performs when you specify the optimize switch. Before I answer that, I want to make sure that something is perfectly clear. The compiler's "usage" string is not lying when it says:
/debug[+|-] Emit debugging information
/optimize[+|-] Enable optimizations
Emitting debug information and optimizing the generated IL are orthogonal; they have no e...Full Article.
Tip# 77: Did you know. How to enable Page Level Tracing for your ASP.NET pages?
Enabling tracing at page level gives you a bunch of information that can be useful while debugging your application.Tracing helps understand which control uses more view state, start/end of PreInit, start/end of Init, start/end of Render, etc. This information appears at the bottom of the page. By default page level tracing is disabled.
Tracing can be enabled at Page Level and also at Application Level
To enable Tracing at Page Level select DOCUME...Full Article.
Tip #75: Did you know.How to maintain scrollposition after post back?
When web pages are posted back to the server, by default user is returned to the top of the page. On a large web page, you might have a requirement to scroll down the user automatically to the last position on the page.
MaintainScrollPositionOnPostBack page property can be used to achieve this in one of the following ways.
- Application level: To set the property by default for all pages in the website, open web.config and add the attribute to t...Full Article.
Tip #76: Did you know. How to hide a non-visual control in your designer?
Some times as you are building your web page, you may want to hide all the non-visual controls like Timer control so that the page looks close to how it would be rendered on your browser.
Our Designer can toggle between displaying and not displaying Non-visual controls using
Ctrl+Shift+N
Display ASP.NET Non-visual controls turned on:
Tip# 78: Did you know. How to navigate using Document Outline?
Document Outline window can be launched from the menu View -> Document Outline, or via short cut key Ctrl-Alt-T. The Document Outline window displays a nested, hierarchical tree of the elements and scripts on the page. It gives you a good overview of the page's content and its layout.
Double-clicking any element listed in the Document Outline window will highlight the corresponding markup for that element in the source view or the element display ...Full Article.
ASP.NET MVC Installer For Visual Studio 2010 Beta 1 And Roadmap
A little while ago I announced our plans for ASP.NET MVC as it relates to Visual Studio 2010. ASP.NET MVC wasn't included as part of Beta 1, which raised a few concerns by some (if not conspiracy theories!) ;). The reason for this was simple as I pointed out:
One thing you'll notice is that ASP.NET MVC is not included in Beta 1. The reason for this is that Beta 1 started locking down before MVC 1.0 shipped. AS...Full Article.
And Get Rid Of Those Pesky Programmers
Every now and then some email or website comes along promising to prove Fred Brooks wrong about this crazy idea he wrote in The Mythical Man Month (highly recommended reading!) that
Saturday, June 6, 2009
Download the New IIS SEO Toolkit Beta
Download the New IIS SEO Toolkit Beta
The Misfit Geek Podcast with Joe Stagner is Now Live!
The Misfit Geek Podcast with Joe Stagner is Now Live!
Alas, Smith and Jones
We have a feature in C# which allows you to declare a " friend assembly". If assembly Smith says that assembly Jones is its friend, then code in Jones is allowed to see "internal" types of Smith as though they were public(*). It's a pretty handy feature for building a "family" of assemblies that share common implementation details.
...Full Article.Alas, Smith and Jones
We have a feature in C# which allows you to declare a " friend assembly". If assembly Smith says that assembly Jones is its friend, then code in Jones is allowed to see "internal" types of Smith as though they were public(*). It's a pretty handy feature for building a "family" of assemblies that share common implementation details.
...Full Article.CodeDom vs T4: two approaches to Code Generation
There are many scenarios where the need to generate source code arises. The MVC helpers I introduced in my last post is one such example. Note that I am focusing on generating source code here, and not on scenarios where you may want to generate IL directly (which certainly do exist as well, but it's a difference discussion).
To pe...Full Article.
CodeDom vs T4: two approaches to Code Generation
There are many scenarios where the need to generate source code arises. The MVC helpers I introduced in my last post is one such example. Note that I am focusing on generating source code here, and not on scenarios where you may want to generate IL directly (which certainly do exist as well, but it's a difference discussion).
To pe...Full Article.
A T4 based approach to creating ASP.NET MVC strongly typed helpers
Earlier this week, I wrote a post on using a BuildProvider to create ActionLink helpers. That approach was using CodeDom to generate the code, and there was quite some user interest in it (and Phil blogged it, which helped!).
A T4 based approach to creating ASP.NET MVC strongly typed helpers
Earlier this week, I wrote a post on using a BuildProvider to create ActionLink helpers. That approach was using CodeDom to generate the code, and there was quite some user interest in it (and Phil blogged it, which helped!).
Tip #73: Did you know... about IIS Search Engine Optimization (SEO) Toolkit Beta
IIS Search Engine Optimization (SEO) Toolkit Beta - is a free toolkit that helps Web developers, hosting providers, and server administrators improve their sites' relevance in search results by recommending how to make them more search engine-friendly. The SEO Toolkit Beta is available for installation via the Microsoft Web Platform Installer 2.0 Beta.
The II...Full Article.
Tip #73: Did you know... about IIS Search Engine Optimization (SEO) Toolkit Beta
IIS Search Engine Optimization (SEO) Toolkit Beta - is a free toolkit that helps Web developers, hosting providers, and server administrators improve their sites' relevance in search results by recommending how to make them more search engine-friendly. The SEO Toolkit Beta is available for installation via the Microsoft Web Platform Installer 2.0 Beta.
The II...Full Article.
Tip #74: Did you know.How to Add and Remove AJAX Extenders in Visual Studio 2008 Designer?
Tip#62 showed you how to add an AJAX Control Toolkit to your Toolbox.
Once you have the toolkit here is how you proceed:
1. Switch to Design View of the page and drag drop ScriptManager control from the AJAX Extensions tab of toolbox to the designer.
2. Drag drop an asp button control to the designer to which you would want to add the extender.</...Full Article.
Tip #74: Did you know.How to Add and Remove AJAX Extenders in Visual Studio 2008 Designer?
Tip#62 showed you how to add an AJAX Control Toolkit to your Toolbox.
Once you have the toolkit here is how you proceed:
1. Switch to Design View of the page and drag drop ScriptManager control from the AJAX Extensions tab of toolbox to the designer.
2. Drag drop an asp button control to the designer to which you would want to add the extender.</...Full Article.
Unknown server tag ‘asp:SearchExpression’ error with QueryExtender control in Visual Studio 2010 Beta 1
One of the cool things about ASP.NET 4.0 is the Query Extender and the ability to search within DataContext without using WHERE clause, writing extensive code etc., It works on the new set of namespace i.e. "System.Web.UI.WebControls.Expressions" namespace.
I am trying to put up an extensive sample using QueryExtender in the next post, but for this post, I wanted to share an error that yo...Full Article.
Unknown server tag ‘asp:SearchExpression’ error with QueryExtender control in Visual Studio 2010 Beta 1
One of the cool things about ASP.NET 4.0 is the Query Extender and the ability to search within DataContext without using WHERE clause, writing extensive code etc., It works on the new set of namespace i.e. "System.Web.UI.WebControls.Expressions" namespace.
I am trying to put up an extensive sample using QueryExtender in the next post, but for this post, I wanted to share an error that yo...Full Article.
ASP.NET 4.0 QueryExtender, AutoCompleteExtender and UpdatePanel – mashing it up all
I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1 recently. It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort.
To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1. Yo...Full Article.
ASP.NET 4.0 QueryExtender, AutoCompleteExtender and UpdatePanel – mashing it up all
I am playing with the ASP.NET 4.0 QueryExtender released as a part of the Visual Studio 2010 Beta 1 recently. It provides endless opportunities for working with data without writing much code and when you combine it with a few Ajax features, gives a truly great user experience with very less effort.
To begin with you need the Visual Studio 2010 Beta 1 and .NET Framework 4.0 Beta 1. Yo...Full Article.
Wednesday, June 3, 2009
Working with XY Scatter Charts in Reporting Services 2008
Recently, I've been fielding a few questions regarding XY Scatter Charts in Reporting Services 2008 (see MSDN Forum Question). We have definitely noticed that working with XY Scatter charts is a bit difficult, and we do appreciate the feedback and will work to improve them in a future release. The remainder of this post will detail how you can successfully b...Full Article.
Working with XY Scatter Charts in Reporting Services 2008
Recently, I've been fielding a few questions regarding XY Scatter Charts in Reporting Services 2008 (see MSDN Forum Question). We have definitely noticed that working with XY Scatter charts is a bit difficult, and we do appreciate the feedback and will work to improve them in a future release. The remainder of this post will detail how you can successfully b...Full Article.
Implementing Incremental Navigation with ASP.NET
Traditionally, website navigation has been focused on minimizing the number of clicks required to open a given page. However, this goal has nothing to do with the real purpose of navigation, which is to make finding information easy, consistent, and transparent to the user. Also, as websites get bigger, traditional navigation controls such as drop-down menus or tree views become impractical. Faster Internet connections and larger screen sizes now allow developers to experiment with n...Full Article.
Implementing Incremental Navigation with ASP.NET
Traditionally, website navigation has been focused on minimizing the number of clicks required to open a given page. However, this goal has nothing to do with the real purpose of navigation, which is to make finding information easy, consistent, and transparent to the user. Also, as websites get bigger, traditional navigation controls such as drop-down menus or tree views become impractical. Faster Internet connections and larger screen sizes now allow developers to experiment with n...Full Article.
Bug Psychology
Fixing bugs is hard.
For the purposes of this posting, I'm talking about those really "crisp" bugs -- those flaws which are entirely due to a failure on the developer's part to correctly implement some mechanistic calculation or ensure some postcondition is met. I'm not talking about oops, we just found out that the product name sounds like a rude word in Urdu, or the specification wasn't quite right so we changed it or the code wasn't adequatel...Full Article.
Bug Psychology
Fixing bugs is hard.
For the purposes of this posting, I'm talking about those really "crisp" bugs -- those flaws which are entirely due to a failure on the developer's part to correctly implement some mechanistic calculation or ensure some postcondition is met. I'm not talking about oops, we just found out that the product name sounds like a rude word in Urdu, or the specification wasn't quite right so we changed it or the code wasn't adequatel...Full Article.
A BuildProvider to simplify your ASP.NET MVC Action Links
One downside of using Html.ActionLink in your views is that it is late bound. e.g. say you write something like this:
<%= Html.ActionLink("Home", "Index", "Home")%>
The second parameter is the Acti...Full Article.
A BuildProvider to simplify your ASP.NET MVC Action Links
One downside of using Html.ActionLink in your views is that it is late bound. e.g. say you write something like this:
<%= Html.ActionLink("Home", "Index", "Home")%>
The second parameter is the Acti...Full Article.
Tip #67: Did you know the list of ASP.Net MVC shortcuts?
Add Controller (Ctrl-M Ctrl-C)
Add Controller is a simple dialog box that lets you quickly add controllers to ASP.Net MVC Applications. Right-Click the 'Controllers' folder or simply press Ctrl-M Ctrl-C to invoke this dialog.
Tip #67: Did you know the list of ASP.Net MVC shortcuts?
Add Controller (Ctrl-M Ctrl-C)
Add Controller is a simple dialog box that lets you quickly add controllers to ASP.Net MVC Applications. Right-Click the 'Controllers' folder or simply press Ctrl-M Ctrl-C to invoke this dialog.
Tip #68 Did you know. How simple it is to attach an existing style sheet to your web page?
Open an existing web site in VWD. Open the page by double clicking on it in solution explorer to which you want to attach the existing style sheet in your web site.
Now, switch to Design View of the page and bring up Select Style Sheet dialog by clicking on menu: Format -> Attach Style Sheet as shown below.
Tip #68 Did you know. How simple it is to attach an existing style sheet to your web page?
Open an existing web site in VWD. Open the page by double clicking on it in solution explorer to which you want to attach the existing style sheet in your web site.
Now, switch to Design View of the page and bring up Select Style Sheet dialog by clicking on menu: Format -> Attach Style Sheet as shown below.
Tip #69: Did you know.The keyboard shortcut for View in Browser?
Ctrl +Shift+W does the trick for you.
This short cut is mentioned under File Menu -> View in Browser.
So if you are still using Select File -> Right click for context menu and then selecting View in Browser as shown below, you may want to start using Ctrl+Shift+W.
Tip #69: Did you know.The keyboard shortcut for View in Browser?
Ctrl +Shift+W does the trick for you.
This short cut is mentioned under File Menu -> View in Browser.
So if you are still using Select File -> Right click for context menu and then selecting View in Browser as shown below, you may want to start using Ctrl+Shift+W.
Tip #70: Did you know. how to install win7 RC IIS through command script?
Windows 7 RC's IIS included ftp 7.5 feature. Installing it from command line is a little bit different than the vista IIS7 command line. It is as following:
start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSide...Full Article.
Tip #70: Did you know. how to install win7 RC IIS through command script?
Windows 7 RC's IIS included ftp 7.5 feature. Installing it from command line is a little bit different than the vista IIS7 command line. It is as following:
start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSide...Full Article.
Tip #71: Did you know... there are several new configuration settings available in FastCGI Extension 1.5 Beta
Following are the new configuration settings available in FastCGI 1.5 Extension Beta:
MonitorChangesTo - This property specifies path to a file, changes to which will trigger a recycle of FastCGI executables running for this FastCGI process pool. If value of this property is blank, file change monitoring is disabled. Path to file can be absolute or relative to folder in which FastCGI process (as specified by Exe...Full Article.
Tip #71: Did you know... there are several new configuration settings available in FastCGI Extension 1.5 Beta
Following are the new configuration settings available in FastCGI 1.5 Extension Beta:
MonitorChangesTo - This property specifies path to a file, changes to which will trigger a recycle of FastCGI executables running for this FastCGI process pool. If value of this property is blank, file change monitoring is disabled. Path to file can be absolute or relative to folder in which FastCGI process (as specified by Exe...Full Article.
IIS Search Engine Optimization Toolkit
SEO (search engine optimization) is one of the important considerations that any Internet web-site needs to design with in mind. A non-trivial percentage of Internet traffic to sites is driven by search engines, and good SEO techniques can help increase site traffic even further.
Likewise, small mistakes can significantly impact the search relevance of your site...Full Article.
IIS Search Engine Optimization Toolkit
SEO (search engine optimization) is one of the important considerations that any Internet web-site needs to design with in mind. A non-trivial percentage of Internet traffic to sites is driven by search engines, and good SEO techniques can help increase site traffic even further.
Likewise, small mistakes can significantly impact the search relevance of your site...Full Article.
Tuesday, June 2, 2009
Cross domain access policy in Silverlight applications
An Alternative Approach To Strongly Typed Helpers
One of the features contained in the MVC Futures project is the ability to generate action links in a strongly typed fashion using expressions. For example:
<%= Html.ActionLink<HomeController>(c => c.Index()) %>
Microsoft Web Platform Installer
One of the cool new releases coming out this year is a small download manager - the Microsoft Web Platform Installer - that makes installing and configuring web server and web development stacks really easy. It is a free tool that you can download from the www.microsoft.com/web site (here is the direct link to the instal...Full Article.
Monday, June 1, 2009
ASP.NET MVC Validation with the Data Annotation Validators
Tip#66: Did you know... how to insert quotes values automatically while typing the attrib values?
It's a nice time saver if you would like the HTML editor to automatically add quotes for the attribute values while you are typing.
To set this option select Tools->Options. Check Show all settings. From the left pane select Text Editor -> HTML -> Format and check the insert attribute value quotes when typing checkbox.
Writing A Page To A String
ASP.NET Pages are designed to stream their output directly to a response stream. This can be a huge performance benefit for large pages as it doesn't require buffering and allocating very large strings before rendering. Allocating large strings can put them on the Large Object Heap which means they'll be sticking around for a while.
May 30th Links: ASP.NET, AJAX, ASP.NET MVC, Visual Studio
Here is the latest in my link-listing series. Also check out my ASP.NET Tips, Tricks and Tutorials page and
Friday, May 29, 2009
LINQ the Bridge between the world of Objects & the world of Data
Using ASP.NET 3.5's ListView and DataPager Controls: Deleting Data
The previous installments in this article series have demonstrated how to display, group, sort, and page through data using the ListView control. In addition to displaying data, the ListView control also provides support for inserting, updating, and deleting data. If the ListView uses a data source control (such as a SqlDataSource or ObjectDataSource) and that data source control is configured to support insert, updating, or deleting, then implementing such functionality in the ListView ...Full Article.
New Webcasts and Podcasts
Two New Videos on ASP.NET MVC
Check Out Ramp Up - a Free Online Learning Program
June's Toolbox Column Now Online
My Toolbox column in the June 2009 issue of MSDN Magazine is available online and includes the following reviews:
- ProjectLocker - ProjectLocker lets you outsource source control, defect tracking, and other common project management tasks to the cloud. Unlike open source hosting sit...Full Article.
When Five Hundred Posts You Reach
. look this good you will not. But man, I tell you, the memory goes.
In the July 1985 issue of Fantasy and Science Fiction, Isaac Asimov wrote:
Yesterday I sat down to write my 321st essay for Fantasy and Science Fiction. [.] It went swimmingly. I was pleased at the ease with which I worked out its construction. It practically wrote itself and I scarcely had to look anything up. I whistled while I worked. An...Full Article.
Why Is The Return Type Parameter Last?
The generic delegate type Func<A, R> is defined as delegate R Func<A, R>(A arg). That is, the argument type is to the left of return type in the declaration of the generic type parameters, but to the right of the return type when they are used. What's up with that? Wouldn't it be a lot more natural to define it as delegate R Func<R, A>(A arg), so that...Full Article.
Tip#65: Did you know...How to quickly create a GridView that is hooked up to a SQL table?
In Tip#64, we showed you how to convert a GridView's bound fields into template fields. In this tip, we will show you how to quickly create a GridView that is hooked up to a SQL table.
Typically, if you want a GridView then you need to add it to the page, and then add the datasource and hook the two up through a wizard. But here's a much quicker way to create and hookup the two.
- First, if you don't have a connection to your database, then you will nee...Full Article.
Tip#64:Did you know . How to convert a GridView column from asp:BoundField to asp:TemplateField in Design View?
Assume that you already have a data source SqlDataSource1 that binds to a simple query returning some details from the Customers table.
LIDNUG: Free Online Virtual Chat with Me Today
LIDNUG (Linked .NET Users Group) is hosting an online chat with me today (Wednesday) from 11:30am to 1pm PST (Pacific Standard Time). Anyone is free to join and the agenda topic will be open - so bring your questions!
Click here to learn more about how to register and attend it.
Hope to chat with you more then,
Scott
Full Article.Windows Vista SP2 and Windows Server 2008 SP2
Bingo Bing :)
Our new search engine, more than just search, it would be a decision engine.
In a bid to provide better search experiences, we will be releasing a new decision engine next week. The official name is Bing. I think it is a cool name and this would definitely improve the traditional experience people find with Search.
Today, people...Full Article.
Error: Could not load file or assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest.
Recently, I was trouble shooting an error for my friend. Despite having all the necessary framework and service packs installed, this error "Could not load file or assembly 'System.Transactions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The module was expected to contain an assembly manifest." was surfacing, every time we tried connecting to a SQL Server instance using...Full Article.
Monday, May 25, 2009
Google's Philosophy - Ten Things
Parsing Twitter Usernames, Hashtags and URLs with ColdFusion
Some time ago, well almost a year ago actually, I posted an article called Parsi...Full Article.
Dynamically creating DeepZoom composition
DoubleAnimation Basics with Silverlight Application
Building an Invoice Application with ASP.NET and Crystal Reports - Part 1
Crystal Reports Charting Fundamentals
Reporting 101: Understanding the Why, What, and How of Reporting Solutions
Creating Parameter Fields in Crystal Reports
Securing ASP.NET Applications
Geographic Data with Crystal Reports
Deploying DTS package in SQL Server 2000
Panic on Mt Si
Being that it's a glorious Memorial Day Weekend up here in the Northwest, my co-worker Eilon (developer lead for ASP.NET MVC) and I decided to go on a hike to Mt Si where we had a bit of a scary moment.
Sunday, May 24, 2009
Azure Basics - Say 'Hello' to the Cloud
Understanding the Crystal Reports Object Model
Examining Various Silverlight Containers
Examining ASP.NET 2.0's Membership, Roles, and Profile - Part 14
The ASP.NET Toolbox includes two Web controls for managing users' passwords: the ChangePassword control and the PasswordRecovery control. The ChangePassword control allows a user signed into the site to change their password by entering their existing password and their new, desired password. The PasswordRecovery control is used to reset or recover a user's password in the event that it has been forgotten. The PasswordRecovery control is used by anonymous users who need to be reminded of ...Full Article.
An Extensive Examination of LINQ: The Standard Query Operators
Query operators are methods that work with a sequence of data and perform some task based on the data. They are created as extension methods on the IEnumerable<T>
interface, which is the interface implemented by classes that hold enumerable data. For example, arrays and the classes in the System.Collections
and System.Collections.Generic
namespaces all implement IEnumerable<T>
. In
An Extensive Examination of LINQ: Using the Query Syntax
LINQ's standard query operators provide dozens of built-in techniques for programmatically enumerating, aggregating, selecting, and filtering data. These standard query operators are implemented as extension functions on the IEnumerable<T>
interface and therefore available to any object that implements this interface, which includes arrays, the collection classes in the System.Collections
...Full Article.
Dynamically Generating and Caching Images in ASP.NET with the GeneratedImage Control
CodePlex is Microsoft's open source project community and provides a free hosting platform for open source projects created in .NET. Microsoft's own ASP.NET team has its own CodePlex page - aspnet.CodePlex.com - where they give code previews for upcoming releases. There you'll find the ASP.NET MVC 1.0 source code, a preview of the ASP.NET AJAX 4.0 Framework, and other future libraries, frameworks, and controls....Full Article.
Image Transforms with the ASP.NET Generated Image Control
Last week's article - Dynamically Generating and Caching Images in ASP.NET with the GeneratedImage Control - looked at how to programmatically create and cache images on the fly using the GeneratedImage control, one of a suite of "Futures" technologies found in the ASP.NET Team's CodePlex site. Programmatically creating and displaying images entails the use of an HTTP Handler ...Full Article.
Customizing ASP.NET's CreateUserWizard Control To Display a Fixed Set of Security Questions
ASP.NET's Membership system and its associated Web controls enable developers to create websites that support user accounts in a fraction of the time that it once did. In a nutshell, the Membership system and the specified provider handle the low-level details of creating a user account, validating a user's credentials, deleting an account, locking out an account, getting information about the currently logged on user, ...Full Article.
Using ASP.NET Routing Without ASP.NET MVC
ASP.NET MVC is a Microsoft-supported framework for creating ASP.NET applications using a Model- View-Controller pattern. In a nutshell, ASP.NET MVC allows developers much finer control over the markup rendered by their web pages, a greater and clearer separation of concerns, better testability, and clea...Full Article.
MouseWheel Behavior for Silverlight
[Full post continued here...]...Full Article.
View Model Pattern with .NET RIA Services
Over the weekend, I saw a question on StackOverflow about combining .NET RIA Services and the ViewModel pattern and answered briefly there, but the topic is worthy of a blog post.
At a high level, .NET RIA Services generates a data model for use in the client presentation tier based on the application log...Full Article.
Locate Me and Virtual Earth Sample for Silverlight
[Full post continued here...]...Full Article.
ViewModel + .NET RIA Services Part 2: Testability, Server Mocking and Dependencies
In Part 1 of ViewModel and .NET RIA Services, which I recommend you check out first if you haven't, I created a simple product search UI using Silverlight and .NET RIA Services using the ViewModel (aka MVVM) pattern. One of benefits of the ViewModel pattern is that it creates a nice contract between the view and associated logic, i.e. a contract between the designer and the developer. Another key benefit of the ViewModel pattern is that it...Full Article.
New Video on Creating a Custom ASP.NET AJAX Control Extender
Visual Studio 2010 and .NET FX 4 Beta 1 ships!
New Web Hosting Series!
Get Started with Visual Web Developer Express 2008!
New Video on ASP.NET
New Web Hosting Tutorials!
3 New Visual Web Developer Videos
New Version of the AJAX Control Toolkit
Sending ELMAH Errors Via GMail
ELMAH is a free, open source error logging system for ASP.NET created by Atif Aziz. This blog post assumes the reader is already familiar with using and configuring ELMAH. If this is not the case, refer to Simone Busoli's article, ELMAH - Error Logging Modules and Handlers...Full Article.
New Tutorials Series on Hosting
I have a new tutorial series on the www.asp.net website that looks at hosting an ASP.NET website with a web host provider. The tutorials are aimed at beginning to intermediate ASP.NET developers interested in learning the ins and outs on how to get a small- to medium-sized ASP.NET application online. As with my previous tutorials on the www.asp.net website (
May's Toolbox Column Now Online
My Toolbox column in the May 2009 issue of MSDN Magazine is available online and includes the following reviews:
- SyncBack Pro - backups are an important part of any IT strategy. For large corporations with established IT departments, backups are automatically performed...Full Article.
Next Four Hosting Tutorials Now Online
The next four tutorials in my Hosting Tutorials on www.asp.net were published over the weekend. These tutorials walk readers through hosting an ASP.NET website with a web host provider and are aimed at beginning to intermediate ASP.NET developers interested in getting a small- to medium-sized ASP.NET application online. The first six hosting tutorials<...Full Article.
In Foof We Trust: A Dialogue
User: The typeof(T) operator in C# essentially means "compiler, generate some code that gives me an object at runtime which represents the type you associate with the name T". It would be nice to have similar operators that could take names of, say, methods and give you other metadata objects, like method infos, property infos, and so on. This would be a more pleasant syntax than passing ugly strings and types and binding flags to ...Full Article.
"foreach" vs "ForEach"
A number of people have asked me why there is no Microsoft-provided "ForEach" sequence operator extension method. The List class has such a method already of course, but there's no reason why such a method could not be created as an extension method for all sequences. It's practically a one-liner:
public static void ForEach<T>(this IEnumerable<T> sequence, Action<T> action)
{ // argument null checking omitted
foreach(...Full Article.
Good Names
Imagine a door with an unusual handle. The handle is five feet off the ground and rotates upwards to open the door. The door has no lock. Is this a good door design?
Sorry. That's not an answerable question. The purpose of almost every door is to prevent something from going through it without preventing everything from going through it. Some doors exist only to mitigate heat loss while allowing anything else through. Some doors exist to keep everyo...Full Article.
Many Happy Returns
Happy birthday Channel Nine! In this episode I finally discover why it is that Charles picked me to be the guinea pig, and I wax verbose on the subject of human brains.
Double Your Dispatch, Double Your Fun
Here's an interesting question I got the other day:
If you have an overloaded operator == then any call to the operator method is "early bound" at compile time according to the compile-time types of the operands. But calling Equals() on an object is a virtual call; the actual method called is bound at runtime according to the runtime type of the receiver. This...Full Article.
Restating the problem
A problem statement:
I am trying to loop though a sequence of strings. How can I determine when I am on the last item in a sequence? I don't see how to do it with "foreach".
Indeed, "foreach" does not make it easy to know when you are almost done. Now, if I were foolish enough to actually answer the question as stated, I'd probably say something like this:
You can do so by eschewing "foreac...Full Article.
Comma Quibbling
[UPDATE: Holy goodness. Apparently this was a more popular pasttime than I anticipated. There's like a hundred solutions in there. Who knew there were that many ways to stick commas in a string? It will take me some time to go through them all, so don't be surprised if it's a couple of weeks until I get them all sorted out.]
Five-Dollar Words For Programmers, Part Five: Reification
Today, another in my series on awesomely arcane words for programmers. Reification is the process of turning something that is normally thought of as an abstract concept into something more concrete. It's from the Latin res facere, "thing making".
<...Full Article.Tip#63: Did you know.How to specify a fixed port for Visual Studio Development Server while using WAPs?
In Tip#21 we showed you how to set a fixed port for the Developer Web Server in Web Sites.
Here is how you will be able to configure this for Web Application Projects.
1. Go to the properties page of WAP. Right Click on your Web Application and click on Properties in context menu. This will take you to the Properties page.
Reasons for voting on questions and answers
I've recently been involved in a few discussions around voting on Stack Overflow, and I think my own "policy" around it may be different to that of others. I thought it would be worth sharing why I personally vote items up or down, and hear your thoughts too. This blog may not be the ideal venue for such a post, but until such time as we have a real "meta" site for Stack Overflow (such as
Get last-modified header from response in ASP.NET
I’ve been working lately with some ASP.NET performance optimization automation HTTP modules. In one of them I needed to know if the last-modified header had been set through the Response.Cache.SetLastModified(DateTime) method. For some reason, there is no API available anywhere within the BCL to retrieve the last modified date of a response – you can only set it.
Since the module wouldn’t work without a way to read the last modified date of the response, I h...Full Article.
Protecting against XML Entity Expansion attacks
One of the critical responsibilities of every developer and architect is to understand, and know how to prevent, as many kinds of security attacks as possible. While there are many types of attacks and many weapons at our disposal to thwart them, the most basic defence we have is input validation. The rule of thumb really needs to be to assume all input from uncontrolled sources is malicious, unless you can prove otherwise. This includes input from end users, as well as input from other syste...Full Article.
ASP.NET MVC For Visual Studio 2010 Beta 1
I apologize for not blogging this over the weekend as I had planned, but the weather this weekend was just fantastic so I spent a lot of time outside with my son.
PPTs opening very slowly? – Check your printer drivers - Microsoft Office 2007 PowerPoint
Recently I seemed to have issues with opening PPT files. I am running Office 2007 for a long time now and one of the things that I use most with respect to my work is PowerPoint files. Over the last 2 weeks I saw a certain weird behaviour with PPTs specifically related to printer options.
Every time, I try to open the PPT or unlock the system with the PPTs open, they try to print to my d...Full Article.
Some important links
Update for .NET 3.5 SP1 (Important if working with Dynamic Data)
http://support.microsoft.com/kb/959209
ASP.NET Compilation Enhancement Fix
Finding installed version, edition and service pack version of SQL Server
Today I wanted to find the version of SQL Server 2008 installed in my machine. I did a quick search and the first support article from Microsoft had the answer to it http://support.microsoft.com/kb/321185
I just modified it a little bit wi...Full Article.
Wednesday, May 20, 2009
The Stack Is An Implementation Detail, Part Two
A number of people have asked me, in the wake of my earlier posting about value types being on the stack, why it is that value types go on the stack but reference types do not.
The short answer is "because they can". And since the stack is cheap, we do put them on the stack when possible.
The long answer is. long.
I'll need to give a high-level description of the memory management strategies that we call "stack" and "heap". He...Full Article.
The Stack Is An Implementation Detail, Part Two
A number of people have asked me, in the wake of my earlier posting about value types being on the stack, why it is that value types go on the stack but reference types do not.
The short answer is "because they can". And since the stack is cheap, we do put them on the stack when possible.
The long answer is. long.
I'll need to give a high-level description of the memory management strategies that we call "stack" and "heap". He...Full Article.
Zip Me Up
Suppose you've got a sequence of Foos and you want to project from that a sequences of Bars. That's straightforward using LINQ:
IEnumerable<Bars> bars = from foo in foos select MakeBar(foo);
or, without the query sugar:
IEnumerable<Bars> bars = foos.Select(foo=>MakeBar(foo));
But what if you have two sequences that you want to project from? Say you've got two sequences of doubles t...Full Article.
Zip Me Up
Suppose you've got a sequence of Foos and you want to project from that a sequences of Bars. That's straightforward using LINQ:
IEnumerable<Bars> bars = from foo in foos select MakeBar(foo);
or, without the query sugar:
IEnumerable<Bars> bars = foos.Select(foo=>MakeBar(foo));
But what if you have two sequences that you want to project from? Say you've got two sequences of doubles t...Full Article.
Reserved and Contextual Keywords
Many programming languages, C# included, treat certain sequences of letters as "special".
Some sequences are so special that they cannot be used as identifiers. Let's call those the "reserved keywords" and the remaining special sequences we'll call the "contextual keywords". They are "contextual" because the character sequence might one meaning in a context where the keyword is expected and another in a context where an identifier is expected.*
The C# specif...Full Article.
Reserved and Contextual Keywords
Many programming languages, C# included, treat certain sequences of letters as "special".
Some sequences are so special that they cannot be used as identifiers. Let's call those the "reserved keywords" and the remaining special sequences we'll call the "contextual keywords". They are "contextual" because the character sequence might one meaning in a context where the keyword is expected and another in a context where an identifier is expected.*
The C# specif...Full Article.
Null Is Not Empty
Back when I started this blog in 2003, one of the first topics I posted on was the difference between Null, Empty and Nothing in VBScript. An excerpt:
Suppose you have a database of sales reports, and you ask the database "what was the total of all sales in August?" but one of the sales...Full Article.
Null Is Not Empty
Back when I started this blog in 2003, one of the first topics I posted on was the difference between Null, Empty and Nothing in VBScript. An excerpt:
Suppose you have a database of sales reports, and you ask the database "what was the total of all sales in August?" but one of the sales...Full Article.
Visual Studio Team Test Quick Reference Guide Now Available
http://vstt2008qrg.codeplex.com/
What's included:
- SETUP CONSIDERATIONS
- WEB TEST CONSIDERATIONS
- WEB SERVICE TEST CONSIDERATIONS
- UNIT TEST CONSIDERATIONS
- LOAD TEST CONSIDERATIONS
- LOAD TEST RIG CONSIDERATION
- PERFORMANCE DATA COLLECTION AND USAGE
- LOAD TEST RESULTS STORE INFORMATION
- TEST CU...Full Article.
Visual Studio Team Test Quick Reference Guide Now Available
http://vstt2008qrg.codeplex.com/
What's included:
- SETUP CONSIDERATIONS
- WEB TEST CONSIDERATIONS
- WEB SERVICE TEST CONSIDERATIONS
- UNIT TEST CONSIDERATIONS
- LOAD TEST CONSIDERATIONS
- LOAD TEST RIG CONSIDERATION
- PERFORMANCE DATA COLLECTION AND USAGE
- LOAD TEST RESULTS STORE INFORMATION
- TEST CU...Full Article.
Justinmind Protyper Looks Promising
I'm just about to give http://www.justinmind.com/learn/video_tutorials a try - I'm always on the lookout for these types of tools. I'll let you know how it goes.
...Full Article.Justinmind Protyper Looks Promising
I'm just about to give http://www.justinmind.com/learn/video_tutorials a try - I'm always on the lookout for these types of tools. I'll let you know how it goes.
...Full Article.Steve and Joel's Daily Scrum
Watch Stephen Forte and I jabber about Scrum at the Microsoft Enterprise Developer and Solutions Conference in New York.
http://entdevcon.telligent.com/sessions/
Lots of other GREAT sessions and partner videos on this site.
Enjoy.
...Full Article.Steve and Joel's Daily Scrum
Watch Stephen Forte and I jabber about Scrum at the Microsoft Enterprise Developer and Solutions Conference in New York.
http://entdevcon.telligent.com/sessions/
Lots of other GREAT sessions and partner videos on this site.
Enjoy.
...Full Article.TechEd 09 - Agile an Excuse or a Process?
One of the panels I was on at TechEd in LA this year has been posted - http://www.msteched.com/online/view.aspx?tid=bacf64af-7c4e-4393-ac7f-5106a7745d9a
Check it out.
...Full Article.TechEd 09 - Agile an Excuse or a Process?
One of the panels I was on at TechEd in LA this year has been posted - http://www.msteched.com/online/view.aspx?tid=bacf64af-7c4e-4393-ac7f-5106a7745d9a
Check it out.
...Full Article.A new flag to optimize ASP.NET compilation behavior
Update (4/22/2009)
Actually downloading this fix for 3.5SP1 has been a confusing topic. Here are links from which you can download it directly without having to call Product Support. Note that even though the links appear to refer to an unrelated issue, the binaries do in fact contain this fix. Sorry for the confusion!
A new flag to optimize ASP.NET compilation behavior
Update (4/22/2009)
Actually downloading this fix for 3.5SP1 has been a confusing topic. Here are links from which you can download it directly without having to call Product Support. Note that even though the links appear to refer to an unrelated issue, the binaries do in fact contain this fix. Sorry for the confusion!
Tip #50: Did you know.How to absolute position the controls in Visual Studio Designer?
Absolute positioning control(s) in the designer can seem confusing at first until you learn the visual cues. You can do one of the following two possible actions by dragging the control in the designer.
- Re-parent the control
- Change the controls position.
When you drag the body of the control, you are changing the parent of the control. You can see this because the cursor changes to the small arrow with a square box.
Tip #50: Did you know.How to absolute position the controls in Visual Studio Designer?
Absolute positioning control(s) in the designer can seem confusing at first until you learn the visual cues. You can do one of the following two possible actions by dragging the control in the designer.
- Re-parent the control
- Change the controls position.
When you drag the body of the control, you are changing the parent of the control. You can see this because the cursor changes to the small arrow with a square box.
Tip #51 Did you know. how to use VS2005 to debug with IE8?
VS2005 does not debug with IE8 by default, due to IE8's LCIE feature ( http://blogs.msdn.com/ie/archive/2008/03/11/ie8-and-loosely-coupled-ie-lcie.aspx). To enable it, please follow the instruction in this thread:
Tip #51 Did you know. how to use VS2005 to debug with IE8?
VS2005 does not debug with IE8 by default, due to IE8's LCIE feature ( http://blogs.msdn.com/ie/archive/2008/03/11/ie8-and-loosely-coupled-ie-lcie.aspx). To enable it, please follow the instruction in this thread:
Tip # 52: Did you know... When deploying your ASP.NET web application, debug=false should be set in web.config
To help troubleshoot problems, developers usually enables the debug mode in web.config file. This causes ASP.NET to produce extra information in the compiled assemblies such as debug symbols, metadata. However, performance will be suffered as it takes longer to compile and run, consumes more memory and resource caching is not performed. Therefore, in production, we should set the debugging option back to false to avoid the effect on performance. There are two ways to achieve this.
1) ...Full Article.
Tip # 52: Did you know... When deploying your ASP.NET web application, debug=false should be set in web.config
To help troubleshoot problems, developers usually enables the debug mode in web.config file. This causes ASP.NET to produce extra information in the compiled assemblies such as debug symbols, metadata. However, performance will be suffered as it takes longer to compile and run, consumes more memory and resource caching is not performed. Therefore, in production, we should set the debugging option back to false to avoid the effect on performance. There are two ways to achieve this.
1) ...Full Article.