Friday, June 27, 2014

Show a perticular element at top of view port using jquery


Requirement:
 Show a particular section on load of the page. only when query string present in URL
 for that page and where div id- showsection exist.


Solution:
  if(document.getElementById("showsection") != null) 
  {
    var str = document.URL.split('?')[1];
    if(str != undefined && str.length>0)
    {
      jQuery("html, body").animate({scrollTop:jQuery("#showsection").offset().top},1000);
    }
  }


In HTML page:
<div id="showsection"></div>
<div id="test">
    test document
</div>

Description:
By placing javascript code in document ready, whole page will be scrolled up and show "test".
You do not have to put anything inside "showsection" div

Monday, June 2, 2014

datagrid - Best Grid Control for ASP.NET MVC

different types of MVC grids

webgrid:
http://jasminewisp.blogspot.in/2013/11/webgrid-in-mvc-3-with-server-side.html
http://www.codeproject.com/Tips/615776/WebGrid-in-ASP-NET-MVC

jqtable
http://www.jtable.org/
http://www.codeproject.com/Articles/277576/AJAX-based-CRUD-tables-using-ASP-NET-MVC-3-and-jTa

grid mvc
http://gridmvc.codeplex.com/

asp.net awesome grid
http://demo.aspnetawesome.com/GridDemo/Grouping

ref:
http://stackoverflow.com/questions/20543265/what-is-the-best-grid-control-for-asp-net-mvc-telerik-devexpress-or-syncfusion
http://newskona.com/5-grid-extension-controls-for-asp-net-web-mvc-application/


Please suggest if you got some more info.