What are AJAX Helpers?

AJAX Helpers are used to create AJAX enabled elements like as Ajax enabled forms and links which performs request asynchronously. AJAX Helpers are extension methods of AJAXHelper class which exist in System.Web.Mvc namespace. AJAX HTML Element Example AJAX-enabled link based on action/controller @Ajax.ActionLink(“Load Products”, “GetProducts”, new AjaxOptions {UpdateTargetId = “Products-container”,… Continue reading

What is Validation Summary?

The ValidationSummary helper displays an unordered list of all validation errors in the ModelState dictionary. It accepts a boolean value (i.e. true or false) and based on boolean value it display the errors. When boolean parameter value is true, it shows only model-level errors and excludes model property-level errors (i.e any… Continue reading

What are Url Helpers?

Url helpers allows you to render HTML links and raw URLs. The output of these helpers is dependent on the routing configuration of your ASP.NET MVC application. HTML Element Example Relative URL @Url.Content(“~/Files/asp.netmvc.pdf”) Output: /Files/asp.netmvc.pdf Based on action/controller @Html.ActionLink(“About Us”, “About”, “Home”) Output: <a href=”/Home/About”>About Us</a> @Html.ActionLink(“About Me”, “About”, “Home”,… Continue reading

Differences between Delegates and Interfaces

Delegate Interface We can define multiple methods by using delegate. Interface defines only a single method. No need to implement multiple times. Need to implement the interface multiple times. Fastest to call at runtime when we know all the parameter types. Well designed interfaces are allowed for generic uses which… Continue reading

What are different types of HTML Helpers?

There are three types of HTML helpers as given below: Inline Html Helpers – These are create in the same view by using the Razor @helper tag. These helpers can be reused only on the same view. @helper ListingItems(string[] items) { <ol> @foreach (string item in items) { <li>@item</li> }… Continue reading

Standard Html Helpers

These helpers are used to render the most common types of HTML elements like as HTML text boxes, checkboxes etc. A list of most common standard html helpers is given below: HTML Element Example TextBox @Html.TextBox(“Textbox1”, “val”) Output: <input id=”Textbox1″ name=”Textbox1″ type=”text” value=”val” /> TextArea @Html.TextArea(“Textarea1”, “val”, 5, 15, null)… Continue reading