Search This Blog

Loading...

Apr 21, 2012

ViewState: How to write view state at the botton of the page in Asp.net


View state is very important factor when you are taking about SEO.It becomes very important when to increase your website ranking in Google, because crawlers read few bytes of keyword from top of each page so if your website is viewstate enabled you may be lose the ranking. However here is the solution to write your viewstate at the bottom of your page.

Apr 10, 2012

C#: How to get Second highest element of Array in C Sharp

You can get the second highest element of array in C# with the help of following code. code is very simple and easy.  
 
int GetSecondElement()
       {
           int[] arr = new int[] { 1, 4, 10, 20 };
           int max = int.MinValue;
           int min = int.MinValue;

           foreach (int j in arr)
           {
               if (j > max)
               {
                   min = max;
                   max = j;

               }
               else 
               {
                   if (j > min)
                       min = j;
               }
           }

           return min;

       }
 
 

Follow by Email