ASP.NET
  Home arrow ASP.NET arrow Event Handling with Atlas Client Controls
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Event Handling with Atlas Client Controls
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2007-05-03

    Table of Contents:
  • Event Handling with Atlas Client Controls
  • Base Methods
  • Handling Control Events
  • Events for Lists

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Event Handling with Atlas Client Controls


    (Page 1 of 4 )

    In this conclusion to a three-part series on Atlas programming, you'll learn about text fields, handling control events, and more. This article is excerpted from chapter four of the book Programming Atlas, written by Christian Wenz (O'Reilly, 2006; ISBN: 0596526725). Copyright © 2006 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

    Text Fields

    A single-line text box is represented in HTML using <input type="text">. This element can also be monitored and controlled using the Atlas library and the appropriate class for it, Sys.UI.TextBox. The functionality provided by Atlas covers keyboard event handling and, of course, both read and write access for the text of the element itself. The methods for the latter task areget_text()andset_text(). Example 4-7 outputs the data entered into the text field, using the same polling approach as in the preceding example (setInterval()) to periodically copy the contents of the text box to an AtlasLabelcontrol.

    Example 4-7. Using an Atlas TextBox control

    ControlTextBox.aspx

    <%@ Page Language="C#" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">
     
    <title>Atlas</title>

      <script language="JavaScript" type="text/javascript">
      function pageLoad() {
        window.setInterval(
         
    function() {
            var label = new Sys.UI.Label($("Label1"));
            var textbox = new Sys.UI.TextBox($("TextBox1"));
            label.set_text(textbox.get_text());
         
    },
         
    1000);
      }
      </script>

    </head>
    <body>
     
    <form id="form1" runat="server">
        <atlas:ScriptManager runat="server">
        </atlas:ScriptManager>
        <div>
         
    <input type="text" id="TextBox1" /><br />
          Entered value: <label id="Label1"></label>
        </div> 
     
    </form>
    </body>
    </html>

    Figure 4-7 shows the result.


    Figure 4-7.  The text in the text box appears in the label

    Single-line text fields (<input type="text">), multiline text fields (<textarea>), and password fields (<input type="password">) have one thing in common: from a JavaScript point of view, they are controlled in the same way. Thevalueproperty provides read and write access to the contents of the field. Therefore, you can useSys.UI.TextBoxfor all three kinds of form fields.

    More ASP.NET Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "Programming Atlas," published by O'Reilly....
     

    Buy this book now. This article is excerpted from chapter four of the book Programming Atlas, written by Christian Wenz (O'Reilly, 2006; ISBN: 0596526725). Check it out today at your favorite bookstore. Buy this book now.

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT