Posts

Showing posts from November, 2016
CaseCading Drop down in MVC4 or 5  First Create the MVC Application. Create a controller for the Case Cading drop down.   For retrieving the data From the Data Base You Have to Create a Entity Model First.  And then add the Bellow Action Methods in Controller                   TestDBEntities  objEntity =  new   TestDBEntities ();          public   ActionResult  Index()         {             ViewBag.Country =  new   SelectList (GetAllcountry(),  "CountryId" ,  "CountryName" );  ...
Image
Bind DropDownList  in  ASP.Net MVC  4 or 5  Using C#   Using Entity Framework      C reat e MVC4 or a pplication ,then  create model  class .       In our model file we will add the below code.             public   class   TeacherlistModel     {          public  System.Web.Mvc. SelectList  SubjectListModel {  get ;  set ; }     }      public   class   SubjectList     {          public   int  SubjectId {  get ;  set ; }          public   string  SubjectName {...
How do I get ASP.NET Web API to return JSON instead of XML?   J ust add the following in  App_Start/WebApiConfig.cs  class in MVC  Web API project. config. Formatters . JsonFormatter . SupportedMediaTypes . Add ( new   MediaTypeHeaderValue ( "text/html" ) ); That makes sure you get  json  on most queries, but you can get  xml  when you send text/xml.