Friday 18 November 2011

Start New Line in JavaScript alert box

How to start New Line in JavaScript alert box?

Code:

 \n is used to start with new line.

alert("Your message successfully sent.\nThanks for contacting.");
 
output:
 
Your message successfully sent.
Thanks for contacting. 

 

onfocus event

OnFocus event. Sometimes you want to clear text when user click in TextBox.

Definition:
The onfocus event occurs when an object gets focus.

Code:
Following the javascript.

<script type="text/javascript">
      function Focus(a)
     {
            if(a.value = = a.defaultValue)
                 a.value = "";
     }
</script>

HTML Code:

<input type="text" value="Email ID"  onfocus="Focus(this)"  id="txtEmail" name="txtEmail" />
 


onblur event

OnBlur event. Sometimes you want to show default value in TextBox when it is empty.

Definition:
The onblur event occurs when an object loses focus.


Code:
Following the javascript.

<script type="text/javascript">
      function Blur(a)
     {
             if(a.value = = "")
                  a.value = a.defaultValue;
     }
</script>

HTML Code:

<input type="text" value="Email ID"  onblur="Blur(this)"  id="txtEmail" name="txtEmail" />

Friday 11 November 2011

How to Move Directory or Rename Directory in C#.Net?

How to Move Directory or Rename Directory in C#.Net?

First add System.IO;

Code:
  string NewName= string.Empty;
  NewName = "RenameFolder";
  Directory.Move("F:\\myFolder", "F:\\" + NewName);

This will move your directory to new directory.


Tuesday 8 November 2011

How to prepare Aalu Poha?

Title: Aalu Poha

Ingredients:

  • 2 cups Poha (Beaten Rice) 
  • 1 Potatoes 
  • 1 Onions 
  • 2 Green Chillies 
  • 1/4 tsp Mustard Seeds
  • 1 sprig Curry leaves
  • 2 tsp Peanuts (optional)
  • 4 tblsp Oil 
  • 1 pinch Turmeric powder 
  • 1 Lemon
  • Few Corainder leaves 
  • Salt to taste 

How to make aloo poha : 

• Soak the poha in water. Wash and drain all the water.
• Add some salt, turmeric powder and keep aside.
• Peel and cut the potatoes into small cubes, chop the onions, chillies, corainder leaves.
• Heat oil and put mustard seeds, peanuts, curry leaves and fry until they crackle.
• Add potatoes, sauté for few minutes, then add chopped onions, chillies. Add little salt because we have already put salt in poha.
• Cook till they are done. Add the poha and stir.
• Keep it on slow flame for 5- 7 minutes.
• Now add lemon juice.
• Garnish with coriander leaves.

Notes:
 
Friends you can also try some other variation of Poha.
1. In green peas seasons you can add green peas with potato.
2. If you like sugar, you can also add 1tsp sugar after when we wash poha.
3. Garnish with grated fresh coconut, fried peanuts.
4. You can also garnish with Sev which more popular in Madhya Pradesh.

Monday 7 November 2011

Comedy circus ka naya daur 6th November 2011


Comedy circus ka naya daur 5th november 2011


How to rename directory in .Net

There is no separate method for renaming the folders in c#.Net. But you can achieve this by using Move method which is in Directory class.
Note: using System.IO namespace.
string path = System.Configuration.ConfigurationSettings.AppSettings["Path"].ToString();
string Fromfolder;
string Tofolder; Fromfolder ="\\"+Fromfolder+"\\";
Tofolder = "\\"+Tofolder+"\\";
Directory.Move(path + Fromfolder, path + Tofolder);