<rss version="2.0" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Imar.Spaanjaars.Com</title><link>http://imar.spaanjaars.com/</link><description>RSS feed with recent stuff posted at http://Imar.Spaanjaars.Com/.</description><ttl>1440</ttl><item><title>Passed My MCPD Web Exams Today</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=466</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=466</guid><category>Blogs / Imar's Blogs</category><description>Today I passed the exam 70-528, part of the MCPD training. </description><author>Imar Spaanjaars</author><pubDate>Tue, 05 Aug 2008 10:39:16 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=466</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=466</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=466</wfw:commentRss><slash:comments>11</slash:comments></item><item><title>Spaanjaars.Toolit.ContentRating: Version 1.1</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=465</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=465</guid><category>Articles / ASP.NET 3.5</category><description>&lt;p&gt;Ever since I wrote &lt;a href="/QuickDocId.aspx?quickdoc=410"&gt;the initial version of my ContentRating control&lt;/a&gt; back in 2006, I received a massive amount of feedback, both as comments below the article and as private e-mails. Not surprisingly, if you consider the article has been read over 19,000 times and has been rated 444 times (at the time of writing).&lt;/p&gt;
		&lt;p&gt;Besides getting a lot of &amp;quot;thank you's&amp;quot; from people who liked the control, I also got a lot of requests for a real-world example of a test site using the control. The test site that shipped with the control used fake data stored in ViewState to simulate a real backing store which obviously didn't cut it for a lot of people. &lt;/p&gt;
		&lt;p&gt;Also, a reader called vgt pointed out a bug in the control where an existing cookie would be overwritten by a new one one, effectively allowing you to vote for the previous item again.&lt;/p&gt;
		&lt;p&gt;Finally, I had a few requests of my own: I didn't like the default data source of 5 integers  if you didn't supply a data source yourself. I also didn't like it that the control didn't raise an exception when you tried to data bind it without a valid data source.&lt;/p&gt;
&lt;p&gt;So, enough reasons to fire up Visual Studio and get my hands dirty on some control fixing. &lt;/p&gt;</description><author>Imar Spaanjaars</author><pubDate>Wed, 16 Jul 2008 19:29:00 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=465</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=465</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=465</wfw:commentRss><slash:comments>5</slash:comments></item><item><title>Fun With Extension Methods - Extending Object Part 1</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=464</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=464</guid><category>Articles / .NET 3.5 General</category><description>    &lt;p&gt;Some time ago I was showing a colleague how to enhance an object's Design Time capabilities (or actually Debug Time) by adding a &lt;span class="CodeInText"&gt;DebuggerDisplayAttribute&lt;/span&gt;. I &lt;a href="http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=391" target="_blank"&gt;blogged about this attribute earlier&lt;/a&gt;, so I won't go into it again now. But what I do want to talk about is the way the attribute gets its data.&lt;/p&gt;
    </description><author>Imar Spaanjaars</author><pubDate>Mon, 14 Jul 2008 20:02:55 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=464</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=464</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=464</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Caching Best Practices</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=463</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=463</guid><category>Blogs / Imar's Blogs</category><description>Shortly after my &lt;a href="/AboutMyBooks.aspx?aboutitem=beginningaspnet35"&gt;ASP.NET 3.5 book&lt;/a&gt; was released in March 2008, I received feedback from Steven Smith who had reviewed the book. He pointed out that the code I am using to retrieve cached objects has a flaw. Fortunately, the problem is only likely to occur in high traffic sites, and is pretty easy to fix. </description><author>Imar Spaanjaars</author><pubDate>Mon, 14 Jul 2008 14:40:11 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=463</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=463</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=463</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Fun With Extension Methods - Extending IDataRecord Part 2 </title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=446</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=446</guid><category>Articles / .NET 3.5 General</category><description>		&lt;p&gt;It's not uncommon that you have a method that accepts an object that implements the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt; or &lt;span class="CodeInText"&gt;IDataReader&lt;/span&gt; interface. It's also not uncommon that you cannot (fully) control the query that drives the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt;. It could be the result of a &lt;span class="CodeInText"&gt;SELECT *&lt;/span&gt; operation (&lt;a href="http://www.adopenstatic.com/faq/selectstarisbad.asp" target="_blank"&gt;bad idea&lt;/a&gt;) or it could be the results of a Stored Procedure for example. Especially in the latter case, it can be useful if you can check whether the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt; contains a specific field. For example, you may want to check if the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt; has a field called &lt;span class="CodeInText"&gt;LastModified&lt;/span&gt; before you try to read and store this field in a local &lt;span class="CodeInText"&gt;DateTime&lt;/span&gt; variable.&lt;/p&gt;
		&lt;p&gt;Unfortunately, the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt; and &lt;span class="CodeInText"&gt;IDataReader&lt;/span&gt; do not implement this behavior directly. However, it's easy to add with a simple extension method. &lt;/p&gt;
		</description><author>Imar Spaanjaars</author><pubDate>Wed, 14 May 2008 18:27:19 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=446</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=446</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=446</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Blogo.NET : A Real World Implementation of my N-Layer Architecture</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=445</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=445</guid><category>Blogs / Imar's Blogs</category><description>Ferdy Christant (also from the Netherlands) recently developed Blogo.NET, a blogging application built with .NET 3.5 and based on the architecture from my &lt;a href="/QuickDocId.aspx?quickdoc=416"&gt;article series on N-Layer design&lt;/a&gt;.</description><author>Imar Spaanjaars</author><pubDate>Wed, 30 Apr 2008 20:31:57 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=445</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=445</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=445</wfw:commentRss><slash:comments>2</slash:comments></item><item><title>Sometimes the Error Message Says It All...</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=444</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=444</guid><category>Blogs / Imar's Blogs</category><description>
		&lt;p&gt;Sometime ago I was working on a Web Application Project in Visual Studio 2008. The web site I was working on couldn't run against the built-in web development server, so I ran the application against IIS 7 on my Windows Vista machine (IMO, that's probably the best reason to upgrade to Windows Vista if you are a web developer: multiple web sites in IIS 7). &lt;/p&gt;&lt;p&gt;Life was good until I started debugging... &lt;/p&gt;
		</description><author>Imar Spaanjaars</author><pubDate>Sat, 05 Apr 2008 18:29:50 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=444</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=444</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=444</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Uploaded MyGeneration Templates for C# Code for my N-Layer Design Articles</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=443</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=443</guid><category>Blogs / Imar's Blogs</category><description>&lt;p&gt;I just uploaded a ZIP file with four MyGeneration templates to generate C# and SQL code that matches the model in my &lt;a href="/QuickDocId.aspx?quickdoc=416"&gt;articles about N-Layer design&lt;/a&gt;.&lt;/p&gt;</description><author>Imar Spaanjaars</author><pubDate>Sat, 05 Apr 2008 17:29:37 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=443</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=443</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=443</wfw:commentRss><slash:comments>4</slash:comments></item><item><title>How to Check if Two Objects Look Like Each Other Without Using Equals</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=442</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=442</guid><category>Articles / ASP.NET 3.5</category><description>&lt;p&gt;
A colleague (from &lt;a href="http://www.designit.nl/" target="_blank"&gt;Design IT&lt;/a&gt;)
and I were discussing a simple way to check two instances of an object. We wanted
to know if all the public properties on one instance were holding the same values
as the one on the other instance. We wanted to use this knowledge in a few unit
tests to simply check all public fields on an instance in one fell swoop.
&lt;/p&gt;
&lt;p&gt;
Since we didn't want this exact behavior at run-time we couldn't override &lt;span class="CodeInText"&gt;
Equals&lt;/span&gt; and check all object's properties, so we had to look for a different
solution.
&lt;/p&gt;
</description><author>Imar Spaanjaars</author><pubDate>Tue, 18 Mar 2008 21:27:08 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=442</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=442</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=442</wfw:commentRss><slash:comments>3</slash:comments></item><item><title>Fun With Extension Methods - Extending IDataRecord </title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=441</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=441</guid><category>Articles / .NET 3.5 General</category><description>&lt;p&gt;For some reason, the &lt;span class="CodeInText"&gt;IDataRecord&lt;/span&gt; interface and classes that implement it (&lt;span class="CodeInText"&gt;DbDataReader&lt;/span&gt;, &lt;span class="CodeInTe`xt"&gt;SqlDataReader&lt;/span&gt; and so on) only have &lt;span class="CodeInText"&gt;Get*&lt;/span&gt; methods that accept the zero-based column index of a column in the result set. They don't allow you to get data by specifying a column name. As an example, consider the private &lt;span class="CodeInText"&gt;FillDataRecord&lt;/span&gt; method to fill an e-mail address, as discussed in my &lt;a href="/QuickDocId.aspx?quickdoc=419"&gt;article series about N-Layer development&lt;/a&gt;. &lt;/p&gt;
		&lt;div class="CodeBorder"&gt;
		&lt;pre class="CodeForeground"&gt;private static EmailAddress FillDataRecord(IDataRecord myDataRecord)
{
  EmailAddress myEmailAddress = new EmailAddress();
  myEmailAddress.Id = 
          myDataRecord.GetInt32(myDataRecord.GetOrdinal("Id"));
  myEmailAddress.Email = 
          myDataRecord.GetString(myDataRecord.GetOrdinal("Email"));
  // More fields here
  return myEmailAddress;
}		&lt;/pre&gt;
		&lt;/div&gt;
		&lt;p&gt;The &lt;span class="CodeInText"&gt;GetInt32&lt;/span&gt; and &lt;span class="CodeInText"&gt;GetString&lt;/span&gt; methods only have a single overload: one that accepts the zero-based index of the column. To satisfy these method signatures and make your code more readable at the same time, you can use &lt;span class="CodeInText"&gt;GetOrdinal&lt;/span&gt; as shown in the previous example. Based on the column's name, &lt;span class="CodeInText"&gt;GetOrdinal&lt;/span&gt; returns the column index. So, given the fact that the &lt;span class="CodeInText"&gt;Id&lt;/span&gt; column is the first in the result set and Email the second, the previous piece of code equates to this: &lt;/p&gt;
		&lt;div class="CodeBorder"&gt;
		&lt;pre class="CodeForeground"&gt;
myEmailAddress.Id = myDataRecord.GetInt32(0);
myEmailAddress.Email = myDataRecord.GetString(1);&lt;/pre&gt;
		&lt;/div&gt;
&lt;p&gt;Clearly, this is much more difficult to read and maintain than the previous example as you need to know the column indices and you should take great care not to mess with the column order in your select statements. &lt;/p&gt;
&lt;p&gt;With a few extension methods, you can have the short syntax of the latter example, but still have readable code as the first example. &lt;/p&gt;</description><author>Imar Spaanjaars</author><pubDate>Mon, 17 Mar 2008 17:39:00 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=441</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=441</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=441</wfw:commentRss><slash:comments>2</slash:comments></item><item><title>Fun With Extension Methods - Extending String to Provide a Better Split Method </title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=440</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=440</guid><category>Articles / .NET 3.5 General</category><description>Do you feel that the standard &lt;span class="CodeInText"&gt;Split&lt;/span&gt; implementation of the &lt;span class="CodeInText"&gt;String&lt;/span&gt; class is a bit awkward to use? Do you keep forgetting you have to declare a char array for the separator? And do you often need to split on multiple characters, like &lt;span class="CodeInText"&gt;\r\n&lt;/span&gt; to split on a line break? In that case, read on. A simple extension method might fix that for you. </description><author>Imar Spaanjaars</author><pubDate>Sun, 02 Mar 2008 14:46:13 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=440</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=440</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=440</wfw:commentRss><slash:comments>3</slash:comments></item><item><title>My Books Have Finally Arrived!</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=439</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=439</guid><category>Blogs / Imar's Blogs</category><description>After almost a year of hard work, today was the day: my new ASP.NET book arrived.</description><author>Imar Spaanjaars</author><pubDate>Mon, 25 Feb 2008 21:17:22 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=439</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=439</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=439</wfw:commentRss><slash:comments>9</slash:comments></item><item><title>www.planetwrox.com Now Live!!</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=438</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=438</guid><category>Blogs / Imar's Blogs</category><description>The demo web site that is used in my new book - &lt;a href="http://www.planetwrox.com/" target="_blank"&gt;www.planetwrox.com&lt;/a&gt; - is now available on-line.</description><author>Imar Spaanjaars</author><pubDate>Tue, 19 Feb 2008 18:09:40 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=438</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=438</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=438</wfw:commentRss><slash:comments>6</slash:comments></item><item><title>Grrrr, I Hate automatic Spam Detection Systems</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=437</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=437</guid><category>Blogs / Imar's Blogs</category><description>I just spent some time answering a question I received from someone called Bill who found an old thread on the &lt;a href="http://p2p.wrox.com" target="_blank"&gt;p2p.wrox.com&lt;/a&gt; forum. 10 seconds after I sent my reply, I received the following automatic reply.</description><author>Imar Spaanjaars</author><pubDate>Sat, 09 Feb 2008 10:22:43 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=437</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=437</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=437</wfw:commentRss><slash:comments>0</slash:comments></item><item><title>Dirty Tricks for Dirty Problems </title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=436</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=436</guid><category>Snippets / JavaScript</category><description>A while ago I needed the ability to display a &amp;quot;no image available&amp;quot; image in a list of products when an image for that product was not available on the server. </description><author>Imar Spaanjaars</author><pubDate>Sun, 03 Feb 2008 13:23:10 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=436</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=436</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=436</wfw:commentRss><slash:comments>3</slash:comments></item><item><title>Talking About My Generation</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=435</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=435</guid><category>Blogs / Imar's Blogs</category><description>Ever since I posted my article series about &lt;a href="http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=416"&gt;N-Layer design&lt;/a&gt;, people asked me if I use any code generators to create the basic framework for the classes used in my model. The usual answer was: yes, I do, but I use a home grown code generator for it, making it impossible to share it with others. Fortunately, that has changed.... </description><author>Imar Spaanjaars</author><pubDate>Sun, 03 Feb 2008 12:10:04 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=435</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=435</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=435</wfw:commentRss><slash:comments>8</slash:comments></item><item><title>Woohoo It's Done!!!</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=434</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=434</guid><category>Blogs / Imar's Blogs</category><description>A few days ago I sent in the last corrections for my new book Beginning ASP.NET 3.5 with C# and VB.</description><author>Imar Spaanjaars</author><pubDate>Thu, 31 Jan 2008 07:20:28 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=434</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=434</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=434</wfw:commentRss><slash:comments>7</slash:comments></item><item><title>Want to Be My Colleague?</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=433</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=433</guid><category>Blogs / Imar's Blogs</category><description>Do you want to be my colleague and get involved in the projects I am working for? Now is your chance, because we're hiring... </description><author>Imar Spaanjaars</author><pubDate>Fri, 18 Jan 2008 21:51:40 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=433</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=433</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=433</wfw:commentRss><slash:comments>3</slash:comments></item><item><title>Fun With Extension Methods - Extending Response.Redirect </title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=432</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=432</guid><category>Articles / .NET 3.5 General</category><description>&lt;p&gt;How often have you written code that redirects to another page and passes some local variables? You probably use &lt;span class="CodeInText"&gt;string.Format&lt;/span&gt; to make your code easier to read. E.g.:&lt;/p&gt;
		&lt;div class="CodeBorder"&gt;
		&lt;pre class="CodeForeground"&gt;int categoryId;
// Code to assign a value to categoryId here
Response.Redirect(string.Format(&amp;quot;SomePage.aspx?CatId={0}&amp;quot;, categoryId.ToString()));&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Have you ever wished there was an overload of the &lt;span class="CodeInText"&gt;Redirect&lt;/span&gt; method that allowed you to omit the call to &lt;span class="CodeInText"&gt;string.Format&lt;/span&gt; and simply let you write something like this:&lt;/p&gt;
				&lt;div class="CodeBorder"&gt;
		&lt;pre class="CodeForeground"&gt;int categoryId;
// Code to assign a value to categoryId here
Response.Redirect(&amp;quot;SomePage.aspx?CatId={0}&amp;quot;, categoryId.ToString());&lt;/pre&gt;
		&lt;/div&gt;
&lt;p&gt;This code makes it much easier to redirect to a page with a number of variables in the Query String. All you need to do is provide a composite format string as the new URL and a bunch of values that are used instead of the placeholders. &lt;/p&gt;
&lt;p&gt;With Extension Methods - that come with .NET 3.5 - you can easily accomplish this yourself. &lt;/p&gt;</description><author>Imar Spaanjaars</author><pubDate>Fri, 31 Aug 2007 23:17:25 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=432</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=432</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=432</wfw:commentRss><slash:comments>5</slash:comments></item><item><title>My New Project</title><link>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=431</link><guid>http://imar.spaanjaars.com/QuickDocId.aspx?QUICKDOC=431</guid><category>Blogs / Imar's Blogs</category><description>Now that Amazon has &lt;a href="http://www.amazon.com/Beginning-ASP-NET-3-5-Imar-Spaanjaars/dp/047018759X" target="_blank"&gt;spilled the beans&lt;/a&gt;, I might as well tell you what the new project is that I am working on, and why it has been so quiet for some time on my own web site. </description><author>Imar Spaanjaars</author><pubDate>Fri, 24 Aug 2007 22:21:12 GMT</pubDate><comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=431</comments><wfw:comments>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=431</wfw:comments><wfw:commentRss>http://imar.spaanjaars.com/Rss/Comments.aspx?ContentId=431</wfw:commentRss><slash:comments>23</slash:comments></item></channel></rss>