skip to content
  • 30 September 2008

    Three C# 2.0/3.0 Syntaxes That You Didn’t Know But Were Afraid to Ask

    Working with other colleagues, I found these C# syntaxes are still not well-known and used, so I thought of blogging on them.

    1 – Properties Without Members

    In the old days, before C# 3.0, we used to write syntax like:

    Read the rest of this entry »

    Tagged under: | 14 comments
  • 23 April 2008

    Response.Redirect and Server.Transfer Demystified

    I still remember the old days when I first learned ASP.NET 1.0, I used to search, like other newcomers, for the differences between Response.Redirect and the Server.Transfer. I found answers such as Server.Transfer had been kept in ASP.NET for backward compatibility with ASP so the recommendation was to use Response.Redirect or that I should be using the Server.Transfer for better performance!

    The truth is every method has a completely different and important use.

    Response.Redirect : When you call this method, ASP.NET will issue HTTP headers that will instruct the browser for the new page tonavigate to and will stop processing any further ASP.NET instruction. The following code:

    Read the rest of this entry »

  • 22 March 2008

    How to HTTP Post in .NET and handle the 500 errors

    If you google you will find a lot of posts that will tell you how to HTTP post (some call it HTML post) in .NET. However, they all fail, or at least the ones I found, to tell you how to handle the returned 500 errors and retrieve the message behind it.

    I have been posting to a service and getting the “500 Internal Server Error” which doesn’t tell much! I had done some research to get the real error behind it. Here is my code snippet in C#:

    Read the rest of this entry »

    Tagged under: | 1 comment