Monday, October 24, 2011

Naan


Ingredients:
  • 2 cups of All Purpose flour (Plain flour or maida)
  • 1 teaspoon active dry yeast
  • 1 teaspoon salt
  • 1 teaspoon sugar
  • Pinch of baking soda
  • 2 tablespoons of oil
  • 2 1/2 tablespoons yogurt (curd or dahi)
  • 3/4 cup lukewarm water
Also needed:
  • 1 teaspoon of clear butter or ghee to butter the Naan
  • 1/4 cup All Purpose flour for rolling
Method:
  1. Dissolve active dry yeast in lukewarm water and let it sit for 10 minutes or until the mixture becomes frothy.
  2. Add sugar, salt and baking soda to the flour and mix well.
  3. Add the oil and yogurt mix, this will become crumbly dough.
  4. Add the water/yeast mixture and make into soft dough.Note: after dough rise will become little softer.
  5. Knead until the dough is smooth. Cover the dough and keep in a warm place for 3-4 hours. The dough should almost be double in volume.
  6.  Heat the oven to 500 degrees with pizza stone for at least thirty minutes so stone is hot. Using a pizza stone will help to give naan close to same kind of heat as clay tandoor.
  7. Next turn the oven to high broil.
  8. Knead the dough for about two to three minutes and divide the dough into six equal parts.
  9. Take each piece of dough, one at a time, and roll into 8-inch oval shape. Dust lightly with dry flour to help with the rolling.
  10. Before putting the Naan in oven, lightly wet your hands and take the rolled Naan, and flipp them between your palms and place onto your baking/pizza stone into the oven.
  11. You can place about 2 Naan on the baking/pizza stone at a time. The Naan will take about 2 to 3 minutes to cook, depending upon your oven. After the Naan is baked(Naan should be golden brown color on top).
  12. Take naan out of the oven and brush lightly with clear butter or ghee.
  13. wait 2 to 3 minutes before baking the next batch of naan. It gives oven the chance to get heated again to max.
  14. Serve Naan with Daal, Chola, Palak Paneer or any vegetable. Enjoy!

Friday, October 21, 2011

JavaScript: Alert.Show(”message”) from ASP.NET code-behind


In highly interactive websites and intranet sites, you probably want to let the users know what’s going on when they delete, save, export etc. on the site. Those kinds of status messages are widely used and are often implemented by a JavaScript alert box on the web page. ASP.NET doesn’t natively support JavaScript functions from the code-behind files. You manually have to print out a script tag and add the alert() call to it.
As easy as it may be, the extensive use of the alert() status message though out a website calls for a unified and simple implementation in order to avoid duplicate code – a centralized method.
In Windows Forms it is very easy to pop up a status message by calling MessageBox.Show(“message”). It is that kind of object model we want in ASP.NET for printing out JavaScript alerts. We want Alert.Show(“message”) in ASP.NET.
Such a thing doesn’t exist so we have to create it our selves.
I’ve written a static class called Alert with one public method called Show. The implementation is as simple as can be. Just put the .cs file in the App_Code folder on your website and you instantly have access to the method from all pages and user controls.


using System.Web;
using System.Text;
using System.Web.UI;

///



/// A JavaScript alert
///

public static class Alert
{

///

/// Shows a client-side JavaScript alert in the browser.
///

/// The message to appear in the alert.
public static void Show(string message)
{
   // Cleans the message to allow single quotation marks
   string cleanMessage = message.Replace("'""\\'");
   string script = "";

   // Gets the executing web page
   Page page = HttpContext.Current.CurrentHandler as Page;

   // Checks if the handler is a Page and that the script isn't allready on the Page
   if (page != null && !page.ClientScript.IsClientScriptBlockRegistered("alert"))
   {
      page.ClientScript.RegisterClientScriptBlock(typeof(Alert), "alert", script);
   }
}  
}

Demonstration


That class of only 30 lines of code enables us to add a JavaScript alert to any page at any time. Here is an example of a Button.Click event handler that uses the method for displaying status messages.
void btnSave_Click(object sender, EventArgs e)
{
   try
   {
      SaveSomething();
      Alert.Show("You document has been saved");
   }
   catch (ReadOnlyException)
   {
      Alert.Show("You do not have write permission to this file");
   }
}

If something was saved without problems, this JavaScript alert box will apear to the user of the website