I know this is the very interesting and need to create a web application with fast and very responsive user interface just like as windows application. The month ago I created a run-time web form designer using the JavaScript and jQuery, the overall work was very good you can design a web form with the drag and drop html controls at run-time, Continue reading “Backbone.js – Building interactive client-side web apps”
Category: MVC
How to show Indian currency symbol in MVC WebGrid
₹ is the new Indian Rupee currency sign.it was presented to the public by the Government of India on 15 July 2010. When you try to show ₹ currnecy symbol using Culture and UCulture, you get the default currency symbol ‘Rs’ not ₹ then you need to set customize the symbol. Same problem occurs when you want to show this symbol in WebGrid in MVC projects. Continue reading “How to show Indian currency symbol in MVC WebGrid”
Bind DropdownList box from the Enum values in MVC4
Yesterday i need to bind a DropDownList control with the Enum type. I have been using the html.DropDownList(name as string, IEnumerable <SelectListItem > )
method to bind show the list of the items but this method need the IEnumerable <SelectListItem > and i have a Enum type. Suppose you have a Enumeration in your model like this:
Public Enum DepartmentList Sales HR Marketing Production End Enum
You can not use this statement, it will gives an error: ‘DepartmentList is the type in model you can use as expression‘
<%-- This is the Wrong way --> <%: Html.DropDownList("test", Model.DepartmentList)%>
So i discover a way to change the Enum type in the array and then cast in to SelectList. And you can do that in a single statement like as:
<div> Select Department: @Html.DropDownList("lstdepartment", new SelectList(Enum.GetValues (typeof(MvcApplication1.Models.Employee.Deaprtmentlist)))) </div>
To Retrieves an array of the values of the constants in a enumeration, we can use the Enum.GetValues() method.
TextArea in mvc web grid
From my recent work i have just need to display tabular data into the textarea and the spinner fields of the MVC WebGrid. For the Spinner fields i have completed work on WebGrid. So now we have the another task to embed the simple html textarea in to WebGrid. Continue reading “TextArea in mvc web grid”
Spinner or numeric up down cell in WebGrid in MVC
The following code shows how to insert jquery spinner control in your WebGrid in MVC project. For it i am showing you a simple example of WebGrid.
The following example contains a webgrid with the employee’s details including their department and salary. The code is implementing spinner into salary field so that user can change the salary through up and down buttons. Continue reading “Spinner or numeric up down cell in WebGrid in MVC”
Filtering records in WebGrid using dropdownlist in MVC
The blog entry demonstrates how you can filter the data on the basis of another control selection such as dropdown list.
The following example contains a dropdownlist with all department names and a webgrid that will contain employee’s details including their department that will be changed on the to dropdownlist selection change. Continue reading “Filtering records in WebGrid using dropdownlist in MVC”
Difference between MVC TempData, ViewData and ViewBag
MVC introduce Tempdata , Viewdata and Viewbag to maintain the View and controller. MVC is supported the framework that are loosely coupled and thing are class structure. Continue reading “Difference between MVC TempData, ViewData and ViewBag”