Gautam Buddha Temple Varanasi,Varanasi - Buddhist Pilgrimage

Thursday, July 2, 2015

how to work with Entity Framework project


Steps to create entity frmawork project
1.Create a class library project for Context name YourProjectNameContext.
2.Right click the project and add new edmx.
3.Before creating edmx ensure that your Database is ready with proper relationship.
4.Open edmx file -> right click -> Add code generation Item -> select ADO.Net Self-tracking Entity Generator.
5.Add new Class library project for Entity named yourProjectNameEntities
6.Drag the .tt from Context project and drop it to Entity project.
7.Delete .tt files from Context project.
7.Reference - install entity framework,add refernce system.runtime.services.
8.Create your website/webapi project and add above created projects to here.


Regards
Santosh Singh
www.varanasitravel.in

Thursday, June 4, 2015

Sticky menu on scroll in html5 and jquery

  Here, we will create a sticky menu bar in very simple way which is built only with CSS and jQuery.  
  1.Write this jquery code in top of your html page  
  <script type="text/javascript">  
     $(document).ready(function () {  
       var stickyTopPos = $('.navbar').offset().top;  
       var stickyNavbar = function () {  
         var scrollTop = $(window).scrollTop();  
         if (scrollTop > stickyTopPos) {  
           $('.navbar').addClass('sticky');  
         } else {  
           $('.navbar').removeClass('sticky');  
         }  
       };  
       stickyNavbar();  
       $(window).scroll(function () {  
         stickyNavbar();  
       });  
     });  
 </script>  
 2.Add this stylesheet  
  <style>  
     .sticky  
     {  
       position: fixed;  
       width: 100%;  
       left: 0;  
       top: 0;  
       z-index: 100;  
       border-top: 0;  
       background-color: #808080;  
     }  
 </style>       
 3.This is our menu  
  <div class="navbar">  
   <ul class="tabs" data-tab>  
     <li class="tab-title active"><a href="#panel1">Menu-1</a></li>  
     <li class="tab-title"><a href="#panel2">Menu-2</a></li>  
     <li class="tab-title"><a href="#panel3">Menu-3</a></li>  
     <li class="tab-title"><a href="#panel4">Menu-4</a></li>  
     <li class="tab-title"><a href="#panel5">Menu-5</a></li>  
     <li class="tab-title"><a href="#panel6">Menu-6</a></li>  
     <li class="tab-title"><a href="#panel7">Menu-7</a></li>     
   </ul>  
   <div class="clear">  
   </div>  
  </div>