Wednesday, October 20, 2010

MVC2 Drop down list

In order to set static value of MVC2 drop down list use below code

binded with entity field
Html.DropDownListFor(model => model.Type, new SelectList(new[] { "JobCatagories","SalaryRange" }))

intendant of entity matching.

Html.DropDownList("DDL", new SelectList(new[] { "JobCatagories", "SalaryRange" }))





Wednesday, March 3, 2010

Loop through table using Jquery

Too loop through table using Jquery, that can also be used to loop nested table/nested structure like, to parse only single table rows just need to change $('#tblPlaceholder > tbody > tr>')

$('#tblPlaceholder > tbody > tr>td >div > table > tbody > tr').each(function() {
var displayedDate = this.cells[1].innerText; //display text of cell
alert(displayedDate);
});

Thursday, February 25, 2010

disable bowser back button

If you have two pages A and B and you are direct from A->B if you dont want to come back to A using browser back button Add this code on content of page or head section of page.

Add Java script deceleration

function noBack() { window.history.forward(); }
noBack();
window.onload = noBack;
window.onpageshow = function(evt) { if (evt.persisted) noBack(); }
window.onunload = function() { void (0); }

end java script decleration
It works on IE,FF

 How to generate Model class and DbContext from existing Data Base using .NET Core  Open the Nuget Manage and run the following command Scaf...