DB driven Molonic menu

November 18, 2009

I’ve had a few emails this week about a post I made about 3 years ago, driving a DHTML menu from a database.

You can get the demo here

Every time you access or consume a service or resource which is outside your control you should always place in an exception block. However you also want to record the request and response, or maybe dissect the response. In my case a custom exception from an Apache box, running Java soap.

   1: catch (System.Net.WebException ex)
   2: {
   3:     string packet = "";
   4:     using (Stream StreamObj = ((HttpWebResponse)ex.Response).GetResponseStream())
   5:     {
   6:         using (StreamReader sr = new StreamReader(StreamObj, Encoding.UTF8))
   7:         {
   8:             packet = sr.ReadToEnd();
   9:         }
  10:     }
  11:     Console.Write(packet);
  12:     Console.ReadLine();
  13: }
This will drop out the response packet, from the exception
you won’t get the full detail, you need to prompt the CLR to
dig deeper into the WebException object.

C# Events tutorial

August 11, 2009

Currently reading

August 3, 2009

LINQ in ActionMicrosoft® .NET: Architecting Applications for the Enterprise (PRO-Developer)517r9jiTNcL._SL210_.jpg

del.icio.us Tags: ,,,,