Click here to Skip to main content
15,898,769 members

Comments by Er Daljeet Singh (Top 146 by date)

Er Daljeet Singh 29-Jun-16 8:24am View    
Instead of writing "Model.CountryId,null" pass the list<selecteditem> and check whether your model have value of not


var listItems = new List<SelectListItem>()
{
new SelectListItem {Text = "Male", Value = "M"},
new SelectListItem {Text = "Female", Value = "F"}
};

@Html.DropDownListFor(m => m.Gender, listItems, string.Empty)
Er Daljeet Singh 29-Jun-16 8:21am View    
try the following link
http://stackoverflow.com/questions/2433306/whats-the-difference-between-iqueryable-and-ienumerable

http://www.dotnet-tricks.com/Tutorial/linq/I8SY160612-IEnumerable-VS-IQueryable.html
Er Daljeet Singh 27-Jul-15 7:57am View    
what do u mean by code behind if your dropdownlist was populated by Jquery.
Er Daljeet Singh 27-Jul-15 7:52am View    
Instead of writing this.form1.Controls.Add(lnk);
write
if (e.Row.Cells[1].Text == "dontselect")
{
lnk.Visible = true;
e.Row.Controls.Add(lnk);
}

hope this work
Er Daljeet Singh 27-Jul-15 7:39am View    
Instead of using " IEnumerable<t> agg = source;"use List<t> agg=source,ToList();
Hope this will work