Tags » ASP .NET MVC

Handle Bootstrap dropdown menu click event

Here, I am going to explain about bootstrap dropdown menu click event. Example

<!DOCTYPE html>
<html>
<head>
http://code.jquery.com/jquery-1.8.3.js
http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js<link
 href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css"rel="stylesheet">

$(window).load(function(){
     $(function(){
         $(".dropdown-menu").on("click", "li", function(event){
             alert("Hello AnojCrazyCoder !!!!");
         })
     })
});

</head>
<body style='margin:30px'>
  
    …
102 more words

Bootstrap Dropwdown Event

Get list of property value from another list based on supplied property name using indexer in c#

Recently in one of our MVC application, I have had a requirement to read property value from one generic list by using property name, i.e. For exa. 909 more words

C#

ASP.NET MVC HttpGet vs HttpPost

Problem:

I have a page that displays list of items. And user can filter the items by create date, title, etc. For example:

<h2>Blog List</h2>

@using (Html.BeginForm("List", "Blog"))
{
 @Html.EditorFor(m => m.Filter.CreateDate)
 @Html.EditorFor(m => m.Filter.Title)

 // Table ... 341 more words
Better Code

SelectList made easy

Source code

When making ASP.NET MVC application you’ll eventually need to use DropDownLists. The way I did it was:

  1. Populate a SelectList with the items I want in the dropdown.
  2. 474 more words
Programming

How do I get ASP.NET Web API to return JSON instead of XML using Chrome?

: http://stackoverflow.com/questions/9847564/how-do-i-get-asp-net-web-api-to-return-json-instead-of-xml-using-chrome

I just add the following in App_Start/WebApiConfig.cs class in my 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. 33 more words

ASP.NET MVC