Tuesday, August 14, 2012

when opening a new tab how can i get the Google search engine 

 

  1. In the Location bar, type about:config and press Enter.
    • The about:config "This might void your warranty!" warning page may appear. Click I'll be careful, I promise!, to continue to the about:config page.
  2. Type browser.newtab.url in the search box.
  3. Double-click the browser.newtab.url preference and change the url from about:newtab to about:blank. Alternately, you can change it to about:home for the Firefox Google home page, or type in your preferred home page, example Google.com.
  4. Click OK and close the about:config tab.

 

 

Wednesday, August 8, 2012

1.Why we need State management to maintain state in Asp.Net?

 Asp.Net Pages are destroyed and re-created with each round trip to the server; therefore, page information will not exist beyond the life cycle of a single page. 


2. What are different state management techniques available in .Net?

Asp.Net provides multiple ways to maintain state between server round trips this can be either client side or server side.

Client Side State Management options:
Storing page information using client-side options doesn't use server resources.
  • View state
  • Control state
  • Hidden fields
  • Cookies
  • Query strings
Server side state management options:
  • Application state
  • Session state
  • Profile properties

Friday, July 27, 2012

Convert file size bytes to megabyte string using c#

Recently I needed to convert a number of bytes to a readable string that represents the number of megabytes or gigabytes.
I created an extension method for FileInfo.Length property being a double. I also changed my method for toDouble to call the other method so that it can be used for both double and long.

FileUpload uploadImageFileControl = (divmain.FindControl("UploadImageFile") as FileUpload);double fileSize = (Convert.ToDouble(uploadImageFileControl.FileBytes.Length.ToString()) / 1024);double fileSize1 = (fileSize / 1024);string fileSizeInMb = (String.Format("{0:0.00}", fileSize1) + "MB");//it will  generate the format of 0.00MB

Monday, December 27, 2010

killing vintage looks, great fuel economy

Let me be upfront at the very beginning. I do not own the Royal Enfield 500 EFI (or simply C5, as it’s known by model code). At least not yet. The dang thing has a wait period of 30 days + in Delhi
and I’ll be lucky to be seated on mine two weeks later, as promised by the dealer.  But true to male fickleness, I now wonder whether the maroon or the unique sea-green number would have been more attractive at traffic-lights.