-->

Sunday, May 19, 2013

How to use HoverMenuExtender in AJAX

HoverMenuExtender enables you to display a pop-up menu when you move the mouse pointer over the target control . This extender is attached to an ASP.NET control and associates that particular control with a pop-up panel that display additional control. Using HoverMenuExtender , you can also specify the position of the pop-up panel in the web-page .

It is very much similar to PopupControlExtender as both the extender display a pop-up panel to show additional context . HoverMenuExtender, in particular , is very useful then you want to display a context menu or you want to provide tips automatically when an ASP.NET control receives focus .


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Hovermenu.aspx.cs" Inherits="Hovermenu" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:Button ID="Button1" runat="server" Text="Hover to learn" />
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>


 
<asp:Panel ID="Panel1" runat="server">
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>Visual basic</asp:ListItem>
<asp:ListItem>DotNet</asp:ListItem>
<asp:ListItem>Ajax Control tool kit</asp:ListItem>
</asp:RadioButtonList>

</asp:Panel></ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID ="RadioButtonList1" />

</Triggers>
</asp:UpdatePanel>

<br />
<asp:HoverMenuExtender TargetControlID ="Button1" PopupControlID ="Panel1" PopupPosition ="Right" OffsetX ="4" OffsetY ="4" PopDelay ="30" ID="HoverMenuExtender1" runat="server"></asp:HoverMenuExtender>

</div>
</form>
</body>
</html>

OutPut:


Wednesday, May 15, 2013

ASP.NET Technologies

In ASP.NET , some of the technologies have been integrated , which make the task of developing websites easy for developers. The combination of these technologies provides a common platform to web developers enabling them to handle complicated databases in an easier manner . These new integrated technologies are as follows:


  • MVC Framework
  • Entity Framework
  • ADO.NET Data Services Framework
  • The Silverlight Technology
  • Dynamic Data Framework.
MVC Framework : In MVC Framework stands for model ,view , and controller . It is an architectural pattern , which is used in software engineering . In programming, It is very general to split an application into separate layers , that is , presentation layer (UI) ,logic, and data access layer that run on different computers, whereas in MVC , the presentation layer is further separated into two parts , such as view and controller.

ADO.NET Entity Framework : ADO.NET Entity framework enables users to visually design models and mappings , tables , and views by using visual studio and .NET framework . Every business application has a conceptual data model that has to deal with data represented in relational form. Even if higher level of conceptual model is used we have to first convert it into relation from and then apply it to logical database schema or relational model. This is done because conceptual model is not directly executable . Entity framework provides capability to program conceptual model. The goal of introducing Entity Framework is to raise the level of abstraction for data programming and to help developers to increase productivity.

ADO.NET Data Service Framework : ADO.NET Data services framework consists of a combination of patterns and libraries that enable the creation and consumption of data services for the web so that it can be consumed by web clients within a corporate network or across the internet . The objective of ADO.NET Data Services framework is to facilitate the creation of  flexible data services that are integrated with the web.

The Silverlight Technology  : Silverlight is a Technology that allows web designers and web developers to stretch the boundaries of web application development. It was formerly known as windows presentation Foundation / everywhere (WPF/E) . Silverlight is a plug-in that can work in a cross-platform ,cross-browser, and cross-device environment . It is an integration of the rich user interface of desktop applications and the transparency of other web languages, such as HTML and JavaScript . Silverlight enables you to develop web application containing high-fidelity multimedia content and eye -catching visual effect.

Dynamic Data Framework : ASP.NET Dynamic Data is a framework that allows you to easily build data driven web application based on the foundation of the entity framework data model or LINQ to SQL data model . The purpose of a data model is to represent the information about the items present in a database . It also depicts the relation between different items of the database.




 


Tuesday, May 14, 2013

How to use TabContainer Control in AJAX

The TabContainer control provides multiple views in a web page . Nowadays , with the increase in the demand for enhanced graphics capabilities , Microsoft has released new products , such as Windows vista , Microsoft Office , and Internet Explorer with tabbed version . The tabs within a page provides you means to view a large amount of information at a single location. The TabContainer control enables you to create a tabbed interface ; where clicking each tab display different contents . Switching from one tab to other does not need a postback .

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="tabcontainer.aspx.cs" Inherits="tabcontainer" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div>
<asp:TabContainer ID="TabContainer1" runat="server" Width ="200px">
<asp:TabPanel ID="tab1" runat ="server">
<HeaderTemplate >
Hot News
 
</HeaderTemplate>
<ContentTemplate >
visit for hot gadget news
 
<a href="http://www.pc-gadgetworld.com">Hot gadget world</a>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="tab2" runat ="server" >
<HeaderTemplate >


Sports
 
</HeaderTemplate>
<ContentTemplate >


hot sports
 
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>
</div>
</form>
</body>
</html>

Output:


Properties of Tab Container Control :
ActiveTabChanged  : Set an event that is fired on the server -side when a tab is changed after a postback.

OnClientActiveTabChanged : Attaches a javaScript function to the client side tabChanged event.

CssClass : Set the CSS class to define custom look for tabs . It overrides the already defined custom look settings.

ActiveTabIndex : Set the tab index that remains visible when the page renders for the first time .

Height : Set the Height of the body of tab.

Width : Sets the width of the body of tabs.

ScrollBars : Determines whether or not the scrollbars should be displayed.

Monday, May 13, 2013

Computer Programming : Advantages or Benefits of .NET framework, explanation

(1) Consistent Programming Model : .NET framework provides a consistent object-oriented programming model across different languages. You can use model to create programs for performing different tasks, such as connecting to and retrieving data from database, and reading from and writing to files.

(2) Cross-platform Support : Any window platform that supports CLR can execute  .NET Application . that is .NET application enables interoperability between multiple window operating systems.

(3) Language Interoperability :  Language interoperability is a feature that enables code written in different languages to interact with each other. This allow reusability of code and improves the efficiency of the development process for example , you can inherit a visual basic class in c# and vice versa. The CLR has a built in support for language interoperability . However , There is no assurance that the code written can be utilized by other developers using another programming language . Hence , to ensure multi-language code interoperability , a set of language features and rules for using them, called the common language specification  (CLS) , is defined . The components that follow these rules and expose only CLS features are said to be CLS-compliant.

(4) Automatic Management of Resource - In .NET , you do not need to manually free the application resources , such as files , network and database connections .NET framework provides a features called CLR that automatically tracks the resources usages and relieves you from the task of manual resource management.

(5) Ease of Deployment - .NET framework makes the task of deployment easier . In most cases , to install an application , you need to copy the application along with its components on the target computer . .NET framework facilities easy deployment of application by installing new application or components that do not have an adverse effect on the existing application. In .NET application are deployed in the form of assemblies . Therefore , registry entries are not required to store information about components and application . In addition ,assemblies also store information about different versions of a single component used by an application . Therefore , the version problem is also eliminated in .NET framework.


Saturday, May 11, 2013

How to use Accordion control in AJAX

The Accordion control groups multiple collapsible panels in a single control and enables you to collapse and expand the panels among them. The Accordion control allows expanding only one panel at a time . The Accordion control contains a collection of child AccordionPane controls . Each of which defines a header and content template. Each pane can contain the different HTML markup . ASP.NET and AJAX markup.



lets take an Example
Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ACoordion.aspx.cs" Inherits="ACoordion" %>

<%@ 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>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Accordion ID="Accordion1" runat="server" Width="374px" AutoSize ="None" FadeTransitions ="true" TransitionDuration ="300" FramesPerSecond ="25" SelectedIndex ="1">
        <Panes >
            <asp:AccordionPane ID="AccordionPane1" runat="server">
            <Header>
           <div style="background-color: #99CC00">Header-1</div>
            </Header>
            <Content >
            hello world
            </Content>
            </asp:AccordionPane>
            <asp:AccordionPane ID="AccordionPane2" runat="server">
             <Header >
           <div style="background-color: #99CC34">header-2</div>
            </Header>
           <Content>
            my name is khan
           </Content>
            </asp:AccordionPane>
            <asp:AccordionPane ID="AccordionPane3" runat="server">
             <Header >
             <div style="background-color: #99CC45">header-3</div>
            </Header>
          <Content >
            raju ban gya gental man
          </Content>
            </asp:AccordionPane>
   
   
        </Panes>





        </asp:Accordion>
    </div>
    </form>
</body>
</html>

OutPut:







Properties of Accordion Control: 
SelectedIndex : Sets the index of the AccordionPane that should remain visible when the page is loaded for the first time.

HeaderCssClass : Sets the css class to apply to the header of the AccodionPanes.

HeaderSelectedCssClass : Sets the css class to apply to the selected header of the AccordionPane.

ContentCssClass : Sets the css class to apply to the contents of the AccordionPane.

FadeTransitions : Determines Whether or not the fading transition effect should be used.

TransitionDuration : Sets the time to animate the transitions.

FramesPerSecond : Sets the number of frames per second used in the transition animation.

AutoSize : Restricts the growth of the Accordion.

RequireOpenedPane : Determines whether or not the currently opened pane should close when its header is clicked.

SuppressheaderPostbacks : Determine whether or not the client-side click handlers inside a header are fired to cause a postback.

Panes : Specifies a collection of AccordionPane controls.

HeaderTemplate : Contain the markup that is used for pane's header during data binding.

ContentTemplate : Contains the markup that should be used for pane's contains when data binding.

DataSource : Specifies the Data source to be used for data binding.

Thursday, May 9, 2013

How to use CollapsiblePanelExtender in AJAX

CollapsiblePanelExtender enables you to hide and show the contents on a page alternatively, this extender builds up a collapsible section in your web page.

lets take an Example

Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<%@ 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>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:LinkButton ID="LinkButton1" runat="server">expand it</asp:LinkButton>
    <asp:Panel ID="Panel1" runat="server" BackColor="#FF3300" ForeColor="White">
        <br />
        <br />
    </asp:Panel>
    <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"
        CollapseControlID="LinkButton1" CollapsedText="please expand it"
        ExpandControlID="LinkButton1" ExpandedText="please collapse it"
        SuppressPostBack="True" TargetControlID="Panel1" Collapsed="True"
        CollapsedSize="0" ExpandedSize="250" TextLabelID="Label1">
    </asp:CollapsiblePanelExtender>
    <div>

    </div>
    </form>
</body>
</html>

OutPut



Tuesday, May 7, 2013

How to use DragPanelExtender in ajax

DragpanelExtender enables you to drag a panel within the webpage .DragPanelExtender adds a drag effect to the panels of your web page . This makes the panels virtually float on the web page . Using this extender , you can easily drag  the panels by clicking their associated drag handles.


lets take an Example

Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )


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

<%@ 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">


<script runat="server">


</script>


<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
    <style >
    .dragpanel
    {
        cursor :move ;
        text-align :center ;
        font-size :large ;
        background-color :Green ;
    }
    
    
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
    
        <asp:Panel ID="Panel1" runat="server">
            <asp:Panel ID="Panel2" runat="server">
            <div class ="dragpanel">
            drag me
            </div>
            </asp:Panel>
            <asp:Panel ID="Panel3" runat="server">
            DragpanelExtender enables you to drag a panel within the webpage .DragPanelExtender adds a drag effect to the panels of your web page . This makes the panels virtually float on the web page . Using this extender ,
             you can easily drag  the panels by clicking their associated drag handles
            </asp:Panel>
        </asp:Panel>
        <asp:DragPanelExtender ID="DragPanelExtender1" runat="server" TargetControlID ="Panel1" DragHandleID ="Panel2">
        </asp:DragPanelExtender>
    
    </div>
    </form>
</body>
</html>

OutPut

How to use DragPanelExtender in ajax


Properties of DragPanelExtender :

TargetControlID: Sets the ID of the panel to which you want to drag.

DragHandleID: Sets the ID of the control to which you want to make treat as a drag handle for the panel.


© Copyright 2013 Computer Programming | All Right Reserved