Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Contents tagged with jQuery

  • Creating Wizard in ASP.NET MVC (Part 3 - jQuery)

    In Part 1 and Part 2 of this article series you developed a wizard in an ASP.NET MVC application using full page postback and Ajax helper respectively. In this final part of this series you will develop a client side wizard using jQuery. The navigation between various wizard steps (Next, Previous) happens without any postback (neither full nor partial). The only step that causes form submission to the server is clicking on the Finish wizard button.

  • Introduction to Developing Mobile Web Applications in ASP.NET MVC 4

    As mobile devices are becoming more and more popular, web developers are also finding it necessary to target mobile devices while building their web sites. While developing a mobile web site is challenging due to the complexity in terms of device detection, screen size and browser support, ASP.NET MVC4 makes a developer's life easy by providing easy ways to develop mobile web applications. To that end this article introduces you to the basics of developing web sites using ASP.NET MVC4 targeted at mobile devices.

  • Dealing with JSON Dates in ASP.NET MVC

    Most of the time, data transfer during Ajax communication is facilitated using JSON format. While JSON format is text based, lightweight and simple it doesn't offer many data types. The data types supported in JSON include string, number, boolean, array, object and null. This support for limited data types poses some difficulties while dealing with dates. Since there is no special representation for dates in JSON, ASP.NET uses its own way to deal with dates. This article discusses how dates are serialized in JSON format by MVC action methods and how to deal with them in your client side jQuery code.

  • Using Custom Data Attributes to Store JSON Data in ASP.NET MVC

    HTML5 custom data attributes (data-*) are used to store arbitrary pieces of metadata about an element. One way to store such metadata in data-* attributes is to create a separate data-* attribute for each piece of information you wish to store. This approach works well if there are only a few data-* attributes. However, at times you need to store a bunch of metadata in data-* attributes. In such cases instead of creating multiple data-* attributes you can create just one data-* attribute and store all the pieces of metadata as an object in JSON format. To that end this article illustrates how custom data attributes can be used to store JSON data in an ASP.NET MVC application.

  • Displaying File Upload Progress using jQuery UI Progressbar Widget

    While uploading large files you may need to display the progress of the file upload operation to the end user. This can be done using HTML5 and jQuery UI's Progressbar widget. While HTML5 also has progress element that can be used to render a progress bar, jQuery UI's Progressbar widget offers more configuration and theming options. In this post you will use XMLHttpRequest (Level 2) object to upload files to the server. The XMLHttpRequest object now supports file upload related events such as progress that can be used to track file upload progress.

  • Displaying a Progress Indicator During jQuery Ajax Calls

    Unlike traditional full page postback, where a user can easily understand that the page is being processed, Ajax based communication doesn't give any clue to the user about the processing being done in the background. This is especially important when the Ajax calls involve lengthy server side processing. It would be nice if you show some progress indicator or wait message to the end user while making Ajax calls. To that end this article shows one simple way of displaying such a progress indicator.

  • Creating Cascading DropDownLists using ASP.NET MVC 4 and jQuery

    Sometimes you need to display DropDownLists in your ASP.NET MVC views such that values in one DropDownList are dependent on the value selected in another DropDownList. The most common example of such a functionality is countries and states DropDownLists where based on a selected country you need to populate the states DropDownList. This article shows how such a cascading DropDownLists can be developed using ASP.NET MVC and jQuery.

  • Using Forms Authentication in ASP.NET Web API

    ASP.NET developers commonly use forms authentication to secure their web pages. Just like ASP.NET web forms and ASP.NET MVC applications, Web API can take advantage of forms authentication to implement authentication and role based security. I have already explained how forms authentication works in web forms and MVC applications. In this post I explain how forms authentication can be used in a Web API being consumed in an MVC application.

  • Three ways of attaching success, failure and completion callbacks to jQuery $.ajax()

    While using jQuery $.ajax you often need to perform some custom operations upon successful completion of the Ajax request. You may also need to handle errors (if any) that are thrown while issuing the request. To that end jQuery allows you to wire three callback functions. Moreover these callbacks can be wired using three distinct techniques as illustrated in this article.

  • Ajax Based Polling in ASP.NET Web Forms and MVC

    Recently a reader asked as to how Ajax polling can be implemented in ASP.NET applications. This short post attempts to answer that question. In the SSE and SignalR techniques mentioned earlier the server sends a notification to the client whenever some interesting event happens on the server. On the other hand Ajax base polling involves the client side code periodically checking the server for some status change.