Monday, March 23, 2015

Attach an event to element to execute only once. Today I have been using JQuery and confront an  interesting situation to click once on a Div. .To do this use One function exist into JQuery . Generally when we attach an event to any element, event functionality remains with the element till element gets removed .If we delete that elements means that functionality has been deleted but if you...

Thursday, March 12, 2015

Route URL Request for Physical file using RouteExistingFiles in MVC4 Here we go:Objective : RouteExistingFiles is beneficial in scenario when have you to prevent access to the files and allow ASP.Net to handle such request using Route.Open your visual studio, click on New Project and select ASP.NET MVC4 Web Application. Specify the name of your first...

Monday, March 9, 2015

Use Html attributes for TextBoxFor in ASP.NET MVC ?

Use Html attributes for TextBoxFor in ASP.NET MVC ? This is the way to generate TextBox with certain properties.     1: @Html.TextBoxFor(model => model.properyName, new { @maxlength="25",disabled = "disabled",@class = "form-control" })This will generate a textbox that matches your property name and will also populate the textbox with...

Sunday, March 8, 2015

Bind DropDownListFor at runtime in MVC Hi Friends, During an implementation of MVC View page ,I struggled little to bind the DropDownList with the runtime value from ViewModel . Here is the pictorial representation to Bind the DropDownList at runtime.   Image Representation As depicted below:     Hope it will help you to bind DropDownListFor...