Web


Normal 0 false false false EN-US X-NONE X-NONE I recently installed TFS 2010 and began to setup my projects, so I decided to create this blog post.  I’m not going to cover the installation aspect of TFS; rather, I’m going to assume that you successfully installed the base software; this blog doesn’t discuss the use […]

Html.Action is a method method that injects a response from the server directly into the UI.  For instance, a controller can have two action methods, then inject the response directly into the UI from the other controller.  Take a look at the sample form below: <p> Main Action</p> <% Html.BeginForm(); %>  <div>  Name: <%= Html.TextBox(“IndexName”) %> </div> <div>  […]

The freely available ASP.NET MVC framework by Telerik has added a new DatePicker control that works similarly to the RadDatePicker control in its ASP.NET AJAX framework.  Below is a sample of that control: <%    Html.Telerik().DatePicker().Name(“Picker”)        .ButtonTitle(“Select Date”)        .ClientEvents((evt) =>            {                evt.OnChange(() =>                    {        […]

The latest release of the open source Telerik ASP.NET MVC framework contains a new calendar control.  This control functions similar to the ASP.NET AJAX calendar extender calendar, where it shows a month view, year view, and decade view, and responds to clicks on the client.  Telerik can also specially process clicks for the server too.  […]

With the new various For methods in MVC (DisplayFor, TextBoxFor, etc.), these methods use a lambda to specify the fields to display/render.  The following form below: <% Html.BeginForm(); %>  <%= Html.ValidationSummary(“The following errors have occurred:”) %>  <%= Html.Hidden(“Story.ProjectPhaseKey”, this.Request.QueryString.Get(“phase”)) %> <%= Html.Hidden(“Story.ProjectKey”, this.RouteData.Values[“id”])%>  <div>  <span>Title</span>  <span>   <%= Html.TextBoxFor(i => i.Story.Title) %>  </span> </div> <div>  <span>Description</span>  <span>   <%= Html.TextAreaFor(i => i.Story.Description) %>  </span> </div>  <div>  <input type=”submit” value=”Save Changes” […]

 Not only does MVC support server-side validation, client-side validation is a possibility too.  Below is a sample form that sets up validation using client-side javascript.  These client-side features are made available from the MicrosoftMvcValidation.js file.  Take a look at the sample form with validation below. <% Html.EnableClientValidation(); %> <% Html.BeginForm(); %> <%= Html.ValidationSummary(“The following errors […]

We are about to talk about client validation soon, but if you already know about it, read on; if not, wait until my next post and come back to this one :-).  I’m writing this now because I just found it.  If you use client validation, it’s important to ensure you enable client validation before the […]

ASP.NET MVC 1 had features built in that allowed you to validate content on the server-side, by specifying the elements to listen to validations for.  These features have been enhanced so that you can use a lambda to specify the field to validate.  Below is an illustration of these new features. <% Html.BeginForm(); %> <%= Html.ValidationSummary(“The […]

    <p> Ajax Custom</p> <p>  <div id=”customresponse”></div>  <% using (Ajax.BeginForm(“AjaxCustom”, new AjaxOptions { UpdateTargetId = “customresponse” })) { %>      <div>   Name: <%= Html.TextBox(“CustomName”)%>  </div>  <div>   Value: <%= Html.TextBox(“CustomValue”)%>  </div>      <input type=”submit” value=”save” />    <% } %></p>   [HttpGet, ChildActionOnly]public ActionResult AjaxCustom(){ return PartialView();} [HttpPost]public ActionResult AjaxCustom(FormCollection post){ return Content(“Success”); //return PartialView();} public ActionResult AjaxIndex(){ return View();}

In ASP.NET web forms, anytime an element within the form post contains an HTML tag (such as a <div> or any other tag), the input that’s posted back to the server is validated, and an exception thrown, if that post contains any HTML tags within it.  This is request validation, and in web forms it can […]

« Previous PageNext Page »