Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

ASP.NET Server Controls

By Exforsys | on August 15, 2005 |
ASP.NET 2.0

ASP.NET Server Controls

In this tutorial you will go through an overview of server controls, adaptive rendering, control state, new controls such as Multiview control, Wizard control, BulletedList, DynamicImage and the FileUpload Control.

One of the significant efforts of ASP.NET 2.0 is to provide developers facilities to build applications for a range of devices including devices that may be created in the future. The software defines a common architecture for Web controls and adapters and unifies the functionality of the mobiles with a guarantee that the developer has not to learn any new programming techniques or API. The process of adaptive rendering of mobile controls in ASP.NET is now extended to ASP.NET controls, thereby blurring the differences between them at the API level. However semantics and usability of mobile and web applications remain distinct.

The features of the new controls that have been included in ASP.NET 2.0 are reflective of the new needs that have been identified and addressed. Personalization, data binding models and control states have received specific focus. All controls have been given the same < asp: > prefix, irrespective of the fact that they are mobile controls or otherwise.

The process of creating different markup and layout for different devices is known as adaptive rendering. Container elements such as forms and pages and controls in ASP.NET are subject to adaptive rendering. The advantage of this technique is that it reduces the code needed to write multi device applications and brings in the concept of ‘write once render everywhere’ into application development. The controls in ASP.NET 2.0 are designed to render anywhere for any type of device. The adapters or extra code adapts the output of a control device so that no function gets lost in the transition.

The adapter is a component that overrides the life cycle stages of controls to allow for device specific handling. ASP.NET maps an adapter to a control for each request that is served. The control references the mapped adapter through the Adapter(protected) property. Composite controls defer to its children for rendering. Custom controls may require adapters to be specifically mapped to them.

Adaptive rendering, therefore, has been made into an internal process of generating a Web page.

Adapters can be extended by creating custom adapters and by device filtering. Built in adapter classes can be extended to modify the appearance of controls for a device or device filtering expressions can be declared to override specific properties.

ASP.NET 2.0 has introduced the concept of Control State to maintain the state of controls across requests. This is clearly distinguished from View state in that the control state is a vital piece of control infrastructure. Control state can be defined as a collection of critical view state data that controls need to function. Since this data is kept separate from the view state, it does not get affected if the view state is disabled. Moreover, Control state has to be implemented using a number of steps.

A control that requires a private state sends a signal to the page by calling RegisterRequiresControlState method of the page class. The code will look like this:

protected override void OnInit(EventArgs e)
……{
…………Page.RegisterRequiresControlState(this);
…………base.OnInit(e)
……}

The control state can be stored in any medium. Generally arrays or collections are used. Each control persists and loads its control state using a pair of overridable methods:

protected override object SaveControlState()

protected override void LoadControlState(Object state)

Control states are similar to View states in so far as they are saved and loaded in the same stage of the pipeline as the view state. It is recommended that controls should make minimum use of the control state except for critical, private information.

The developer should be conscious that all control states require serialization and deserialization and this can be done only by calling the SaveControlState and LoadControlState methods. It is also important to remember that all objects that form the control state must be serializable.

ASP.NET introduces a number of new controls. The first of these is the Panel control. Other controls can be added to the panel control and it supports vertical and horizontal scrollbars which are implemented through the overflow CSS style.

The Multi view control presents a number of views to the client, however only one of them will be the active view. The active view is a view object. The active view can be changed using the postback events when the user clicks a button or links which are embedded in the current view. A new view can be indicated by setting the ActiveViewIndex property or the view object can be passed to the ActiveView method.

The WizardControl is a control that is similar to the multiview control. It is a composite control that internally uses the multiview control to display and hide panels. The control has a number of navigation buttons that can be used to trigger server side events. Both linear and non linear navigation has been made possible. The finish button collects all the data and processes them. It must be noted that all the controls are part of a page and hence they can be accessed code wise.

The BulletedList control is a control built around the < ul > and < ol > HTML tags. However, it has some features that are unique. The bullet style, the data binding feature and the custom images are uniquely its own. The control lets the developer choose the style of the element that precedes the item. Numbers, squares, circles and upper or lower cases can be used. Child items can be hyperlinks, plain texts or buttons.

The DynamicImage Control is a wrapper around the tag. It has the capability of adapting images based on the capacity of the requesting browser. A number of new properties have been added to this control to provide for these functionalities. The source image can be expressed as an array of bytes, a file, or an image generation service. The ImageBytes property can be used for passing a file. If the ImageGenerator URL property is set the image can be dynamically generated. If parameters have to be passed the < asp:parameter > control can be used. The image generator has a .asix extension.

The FileUpload Control as the name suggests uploads files using the HtmlInputFile server control. This control is a wrapper around the < input type="file"/ > HTML tag. This control provides an abstract interface compared to the FileUpload control. Users can upload files or select a file for upload using the Browse button on the client machine. However, the FileUpload control does not automatically save a file to the server. The user has to specifically cause the postback and file upload. The control can be accessed by using the FileName property or FileContent property. Specific content in the file can be accessed by using the PostedFile property. The SaveAs method makes a copy of the file on the server side. Exception will be thrown if the folder does not exist.

This tutorial has covered the major components that are required for creating an ASP.NET 2.0 application. The development environment, the page object and the controls have been examined in some detail to familiarize the user with the software. The Visual Studio.NET 2005 interface delivers a high quality IDE that makes for rapid application development and saves the developer much of the drudgery of creating code repeatedly for controls that are frequently used.

In the next tutorial of the series we shall explore the use of Master pages which is a new feature in ASP.NET 2.0.

« « Oracle Apps 11i: Setting up Chart Of Accounts (COA)
ASP.NET Creating Content for Master Page » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 392 Followers
  • Popular
  • Recent
  • ASP.NET Creating Content for Master Page

    August 17, 2005 - 0 Comment
  • ASP.NET Creating Web Wizards

    September 16, 2005 - 0 Comment
  • ASP.NET – Adding Web Parts at Run Time

    August 22, 2005 - 0 Comment
  • ASP.NET Data Source Object Model

    September 6, 2005 - 0 Comment
  • ASP.NET Referencing Master Page Members

    August 17, 2005 - 0 Comment
  • ASP.NET : Dynamic Image control

    September 16, 2005 - 0 Comment
  • ASP.NET Personalization: User Profiles and Themes

    August 23, 2005 - 0 Comment
  • Getting started with ASP.NET 2.0

    July 4, 2005 - 0 Comment
  • ASP.NET SqlDataSource Control

    September 6, 2005 - 0 Comment
  • ASP.NET Changing Master Pages Dynamically

    August 18, 2005 - 0 Comment
  • Application Development in .NET

    November 21, 2007 - 0 Comment
  • ASP.NET Advanced Site Functionality

    September 16, 2005 - 0 Comment
  • ASP.NET : Dynamic Image control

    September 16, 2005 - 0 Comment
  • ASP.NET Creating Web Wizards

    September 16, 2005 - 0 Comment
  • Displaying Master-Detail Data on Separate Pages in ASP.NET

    September 16, 2005 - 0 Comment
  • ASP.NET Displaying Master-Detail Data on the Same Page

    September 13, 2005 - 0 Comment
  • ASP.NET DataBound Controls – Details View

    September 13, 2005 - 0 Comment
  • ASP.NET Using a Grid to Display Detail Information

    September 13, 2005 - 0 Comment
  • ASP.NET Adding Sorting and Paging in GridView

    September 10, 2005 - 0 Comment
  • ASP.NET GridView Filtering

    September 10, 2005 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • Application Development in .NET
  • ASP.NET Advanced Site Functionality
  • ASP.NET : Dynamic Image control
  • ASP.NET Creating Web Wizards
  • Displaying Master-Detail Data on Separate Pages in ASP.NET

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT