Let us learn AJAX Visible Control

Raj.Trivedi
Posted by in ASP.NET AJAX category on for Beginner level | Points: 250 | Views : 4570 red flag

In this article we will see how we can use always visible control and what are its uses.

Introduction


Many times we need to display a content that is always visible on page whether you scroll down or up.This can be achieved by using always visible control.


Objective


  1. Understanding the Always Visible control and its properties.



Using the code


  1. Create an Empty Website in VS2010 and then add a web form.
  2. Now we need to embed AjaxControlToolkit in the Website for that please follow the steps 1-12 in the following article Link :- http://www.dotnetfunda.com/articles/article2344-upload-image-using-ajax-async-file-uploader-in-database.aspx
  3. Remember :- We are working with Always Visible control so we need to drag and drop Always Visible control  and not A SYNC Up-loader.
Lets start Implementation


// HMTL Mark up
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AlwaysVisibleControl.aspx.cs"
    Inherits="AlwaysVisibleControl" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!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></title>
    <style type="text/css">
        .style1
        {
            font-size: xx-large;
        }
    </style>
</head>
<body style="font-size: small">
    <form id="form1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    <div class="style1" style="text-align: center; font-family: 'Angsana New'">
        Always Visible Control of AJAX<br />
        <br />
        <br />
        <div>
        ASP.NET AJAX is a free framework for building a new generation of richer, 
            <br />
            more interactive, highly personalized cross-browser web applications. This new web 
            <br />
            development technology from Microsoft integrates cross-browser client script libraries 
            <br />
            with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX 
            <br />
            offers you the same type of development platform for client-based web pages that ASP.NET 
            <br />
            offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, 
            <br />
            it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily 
            <br />
            take advantage of AJAX techniques on the web and enables you to create ASP.NET pages 
            <br />
            with a rich, responsive UI and server communication. However, AJAX isn't just for 
            <br />
            ASP.NET. You can take advantage of the rich client framework to easily 
            <br />
            build client-centric web applications that integrate with any backend data provider a<br />
            nd run on most modern browsers. 

ASP.NET AJAX is a free framework for building a 
            <br />
            new generation of richer, more interactive, highly personalized cross-browser w<br />
            eb applications. This new web development technology from Microsoft integrates 
            <br />
            cross-browser client script libraries with the ASP.NET 2.0 server-based development<br />
&nbsp;framework. In addition, ASP.NET AJAX offers you the same type of development 
            <br />
            platform for client-based web pages that ASP.NET offers for server-based pages. 
            <br />
            And because ASP.NET AJAX is an extension of ASP.NET,<br />
&nbsp;it is fully integrated
            <br />
            with server-based services. ASP.NET AJAX makes it possible to easily take 
            <br />
            advantage of AJAX techniques on the web and enables you to create A<br />
            SP.NET pages with a rich, responsive UI and server communication. However, A<br />
            JAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser 
            <br />
            client script libraries with the ASP.NET 2.0 server-based development framework. 
            <br />
            In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and
            <br />
            enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

ASP.NET AJAX is a free framework for building a new generation of richer, more interactive, highly personalized cross-browser web applications. This new web development technology from Microsoft integrates cross-browser client script libraries with the ASP.NET 2.0 server-based development framework. In addition, ASP.NET AJAX offers you the same type of development platform for client-based web pages that ASP.NET offers for server-based pages. And because ASP.NET AJAX is an extension of ASP.NET, it is fully integrated with server-based services. ASP.NET AJAX makes it possible to easily take advantage of AJAX techniques on the web and enables you to create ASP.NET pages with a rich, responsive UI and server communication. However, AJAX isn't just for ASP.NET. You can take advantage of the rich client framework to easily build client-centric web applications that integrate with any backend data provider and run on most modern browsers. 

        </div>
        <span class="style1">
        <asp:Label ID="lblTime" runat="server" Text="Label"></asp:Label>
        <br />
        <br />
        </span>
        <asp:AlwaysVisibleControlExtender ID="ajaxave" TargetControlID="lblTime" VerticalSide="Top"
            VerticalOffset="10" HorizontalSide="Right" HorizontalOffset="10" ScrollEffectDuration=".1"
            runat="server">
        </asp:AlwaysVisibleControlExtender>
    </div>
    </form>
</body>
</html>
Now let us understand important properties


  1. TargetControlID :-  This is the id of the control that we want to make it visible.In this case it is our label showing current time.
  2. HorizontalOffset :- This is distance of the control from the edge of the browser horizontally.Default value is 0 pixel
  3. HorizontalSide :- This allows to set the horizontal position of the control (left,right,center).
  4. VerticalOffset :- This is distance of the control from the edge of the browser vertically.Default value is 0 pixel
  5. ScrollEffectDuration :- It specifies the length of scrolling effect in seconds.Default Value is .1
  6. UseAnimation :- It sets whether the animation has to be made to the control,by default = false.

Output:-




Conclusion


This will help users to display content that needs to be displayed while scrolling

Reference


http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AlwaysVisibleControl/AlwaysVisibleControl.aspx

Page copy protected against web site content infringement by Copyscape

About the Author

Raj.Trivedi
Full Name: Raj Trivedi
Member Level:
Member Status: Member,MVP
Member Since: 6/16/2012 2:04:41 AM
Country: India
Regard's Raj.Trivedi "Sharing is Caring" Please mark as answer if your Query is resolved
http://www.dotnetfunda.com/profile/raj.trivedi.aspx
Raj Trivedi i.e. me started my career as Support Professional and then moved on the Software development eventually reached at these skills Software Development | Enthusiastic Blogger | Content Writer | Technical Writer | Problem Solver | Lecturer on Technology Subjects | Runnerup Award Winner on www.dotnetfunda.com and firm believer in Sharing as a way of Caring Yet this much achieved its still a long way to go and there is biggest dream lying to be one of the best entrepreneurs of India in Technology Department. The Dream has just started and i hope it follows. Highlights are mentioned in details in my profile at http://in.linkedin.com/pub/raj-trivedi/30/61/b30/

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)