.NET news » Search results
Search results for query "jquery" (40):
Using ASP.NET, Membership, and jQuery to Determine Username Availability
Chances are, at some point you've tried creating a new user account on a website and were told that the username you selected was already taken. This is especially common on very large websites with millions of members, but can happen on smaller websites with common usernames, such as people's names or popular words or phrases in the lexicon of the online community that frequents the website. If the user registration process is short and sweet, most users won't balk when they are told their desired username has already been taken - they'll just try a new one. But if the user registration process is long, involving several questions and scrolling, it can be frustrating to complete the registration process only to be told you need to return to the top of the page to try a different username.
Many websites use Ajax techniques to check whether a visitor's desired username is available as soon as they enter it (rather than waiting for them to submit the form). This article shows how to implement such a feature in an ASP.NET website using Membership and jQuery. This article includes a demo available for download that implements this behavior in an ASP.NET WebForms application that uses the CreateUserWizard control to register new users. However, the concepts in this article can be applied to ad-hoc user registration pages and ASP.NET MVC.
Read on to learn more!
Live Chat - Template Code
Checking All Checkboxes in a GridView Using jQuery
In May 2006 I wrote two articles that showed how to add a column of checkboxes to a GridView and offer the ability for users to check (or uncheck) all checkboxes in the column with a single click of the mouse. The first article, Checking All CheckBoxes in a GridView, showed how to add "Check All" and "Uncheck All" buttons to the page above the GridView that, when clicked, checked or unchecked all of the checkboxes. The second article, Checking All CheckBoxes in a GridView Using Client-Side Script and a Check All CheckBox, detailed how to add a checkbox to the checkbox column in the grid's header row that would check or uncheck all checkboxes in the column. Both articles showed how to implement such functionality on the client-side, thereby removing the need for a postback.
The JavaScript presented in these two previous articles still works, but the techniques used are a bit antiquated and hamfisted given the advances made in JavaScript
programming over the past few years. For instance, the script presented in the previous articles uses server-side code in the GridView's DataBound event
handler to assign a client-side onclick event handler to each checkbox. While this works, it violates the tenets of unobtrusive
JavaScript, which is a design guideline for JavaScript programming that encourages a clean separation of functionality from presentation. (Ideally, event handlers
for HTML elements are defined in script.) Also, the quantity of JavaScript used in the two previous articles is quite hefty compared to the amount of code that would
be needed using modern JavaScript libraries like jQuery.
This article presents updated JavaScript for checking (and unchecking) all checkboxes within a GridView. The two examples from the previous articles - checking/unchecking all checkboxes using a button and checking/unchecking all checkboxes using a checkbox in the header row - are reimplemented here using jQuery and unobtrusive JavaScript techniques.
Webpart/Portlet development in ASP.NET MVC Framework
Forecast: Cloudy: Multi-Platform Windows Azure Storage
ComponentModel for ASP.NET MVC3
CODE Magazine: 2011 May/Jun
JavaScript comes in many colors and flavors. In this issue you will learn about using JavaScript in your web applications. Learn plug in development with jQuery UI, examine object oriented concepts with Mootools and explore the world of Async javascript with node.js.
Accessing Server-Side Data from Client Script (Part 2)
Today's websites commonly exchange information between the browser and the web server using Ajax techniques. In a nutshell, the browser executes JavaScript code typically in response to the page loading or some user action. This JavaScript makes an asynchronous HTTP request to the server. The server processes this request and, perhaps, returns data that the browser can then seamlessly integrate into the web page. Typically, the information exchanged between the browser and server is serialized into JSON, an open, text-based serialization format that is both human-readable and platform independent.
Adding such targeted, lightweight Ajax capabilities to your ASP.NET website requires two steps: first, you must create some mechanism on the server that accepts requests
from client-side script and returns a JSON payload in response; second, you need to write JavaScript in your ASP.NET page to make an HTTP request to this service you created
and to work with the returned results. This article series examines a variety of techniques for implementing such scenarios. In
Part 1 we used an ASP.NET page and the
JavaScriptSerializer class to create a
server-side service. This service was called from the browser using the free, open-source jQuery JavaScript library.
This article continues our examination of techniques for implementing lightweight Ajax scenarios in an ASP.NET website. Specifically, it examines how to create ASP.NET Ajax Web Services on the server-side and how to use both the ASP.NET Ajax Library and jQuery to consume them from the client-side.
ASP.NET MVC 4: What’s New for Mobile Development in ASP.NET MVC 4
Accessing Server-Side Data from Client Script (Part 1)
When building a web application, we must decide how and when the browser will communicate with the web server. The ASP.NET WebForms model greatly simplifies web development
by providing a straightforward mechanism for exchanging data between the browser and the server. With WebForms, each ASP.NET page's rendered output includes a
<form> element that performs a postback to the same page whenever a Button control within the form is clicked, or whenever the user modifies
a control whose AutoPostBack property is set to True. On postback, the server sends the entire contents of the web page back to the browser, which then
displays this new content. With WebForms we don't need to spend much time or effort thinking about how or when the browser will communicate with the server or how that
returned information will be processed by the browser. It just works.
While this approach certainly works and has its advantages, it's not without its drawbacks. The primary concern with postback forms is that they require a large amount of information to be exchanged between the browser and the server. Specifically, the browser sends back all of its form fields (including hidden ones, like view state, which may be quite large) and then the server sends back the entire contents of the web page. Granted, there are scenarios where this large quantity of data needs to be exchanged, but in many cases we can use techniques that exchange much less information. However, these techniques necessitate spending more time and effort thinking about how and when to have the browser communicate with the server and intelligently deciding on what information needs to be exchanged.
This article, the first in a multi-part series, examines different techniques for accessing server-side data from a browser using client-side script. Throughout this series we will explore alternative ways to expose data on the server so that it can be accessed from the browser using script; we will also examine various tools for communicating with the server from JavaScript, including jQuery and the ASP.NET AJAX library.


Syndicate