Skip to content

Instantly share code, notes, and snippets.

View kshyju's full-sized avatar

Shyju Krishnankutty kshyju

View GitHub Profile
@kshyju
kshyju / jQuery autocomplete
Created February 28, 2014 16:14
jQuery autocomplete load data from a custom object list via ajax
$("#txtSearch").autocomplete({
source: function (request, response) {
$.ajax({
url: "/Home/Getsrchresult",
type: "POST",
dataType: "json",
data: { term: request.term,location:$('#location').val() },
success: function (data) {
response($.map(data, function (item) {
return { label: item.srchresult+"-"+item.place, value: item.srchresult+"-"+item.place };
@kshyju
kshyju / unittest
Created January 24, 2014 21:45
Unit testing using Rhino
[Test]
public void Index_Action_Should_Return_BugsListVM_Object_With_Correct_Number_Of_Issues()
{
//IF the db has 2 issues of Location "SPRNT", the Index action should return 2 items in the Model/ViewModel
//Arrange
const int fakeTeamID = 1;
var _session = MockRepository.GenerateStrictMock<HttpSessionStateBase>();
@kshyju
kshyju / renderpartialview
Created January 23, 2014 19:16
renderpartialview
protected string RenderPartialView(string viewName, object model, ViewDataDictionary dictionary = null)
{
if (string.IsNullOrEmpty(viewName))
viewName = this.ControllerContext.RouteData.GetRequiredString("action");
this.ViewData.Model = model;
if (dictionary != null)
{
foreach (var item in dictionary.Keys)
{
body
{
font-family: 'WOL_SB','Segoe UI Semibold','Segoe UI',Tahoma,Helvetica,sans-serif;
}
#tblAdd
{
margin:0 auto;