Archive for the ‘AJAX’ Category


When trying to add a WaterMark to a TextBox control, you can try the following using the Ajax Control Toolkit:

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>WaterMark Extender</title>
</head>
<body>
    <form id="frm_main" runat="server">
        <asp:ScriptManager ID="scr_main" runat="server" />
        <asp:UpdatePanel ID="ajax_upd_pnl_main" runat="server">
            <ContentTemplate>
                <div id="div_main">
                    <asp:TextBox ID="txt_year" runat="server"></asp:TextBox></div>
                    <cc1:TextBoxWatermarkExtender ID="wme_txt_year" runat="server" TargetControlID="txt_year" WatermarkText="(year)"></cc1:TextBoxWatermarkExtender>          
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </form>
</body>
</html>
Advertisements

When trying to set focus to a control with AJAX, you can try the following:
ASP.Net (Code Behind)

' Declare variables
Dim lscr_mgr As ScriptManager = ScriptManager.GetCurrent(Page)
lscr_mgr.SetFocus([your_control_name].ClientID)

AJAX Business Benefits

Posted: December 23, 2008 in AJAX

AJAX stands for Asynchronous Javascript and XML.  This is a method of employing behaviour in the browser to provide truly dynamic content on a web page without the page-refresh.   Ajax effectively does away with the traditional ‘Click-and-Wait’ web-application architecture of yesterday, making it possible to provide the responsiveness and interactivity users expect from desktop applications.  Ajax’s ability to pull data from the server after the page has loaded contrasts with what we now refer to as the ‘traditional architecture’.  In a traditional architecture the user must wait for the entire webpage to reload to see new results from the server.  In an application that requires a lot of interactivity with the business layer sitting on the server, the user must reload the entire page many times.  This has implications for the efficiency of workflow, the load placed on the server hosting the application, and the productivity of users.

Potentially Measurable Benefits

Time Spent Waiting for Data to be Transmitted
Time is money. Over many repetitions, the time employees spend waiting
for the page to load can add up to significant costs.

Time Spent Completing a Particular Task
Increased efficiency in the user interface can often mean that time is saved at the task-level, offering opportunities for concrete cost savings there.

Bandwidth Consumed for the Entire Task
Cost of bandwidth increases as the company invests in larger-capacity internet connections and new hardware to accommodate greater server loads.  If repetitious tasks consume a lot of bandwidth, these costs can escalate dramatically.  The amount of bandwidth consumed also has implications for time savings.

Hard to Quantity Benefits

Steps to Complete a Task
Reducing the number of steps has implications for the amount of time consumed but also for the number of opportunities for error.  Fewer errors mean cost savings down the road when these errors would have to be manually corrected.

Familiar User Interface
Quite often these days, web based applications are used to replace desktop applications that had superior user interfaces.  The benefits of offering users a similar or even just a familiar user interface to what they use on the desktop means lower training costs, fewer errors, and greater initial productivity.

Improved Application Responsiveness
More responsive applications can improve productivity not just by reducing ‘wait’, but by promoting a more fluid, uninterrupted workflow.  In a responsive application, users can move rapidly from one action to another as quickly as they can visualize the  workflow.  Less responsive applications can defeat the user’s workflow visualisation by forcing them to continually wait for program information.