Wednesday, September 21

Ajax hovermenuExtender,DragPanelExtender,


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="shibashish" %>

<!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">
<script>
function clientActiveTabChanged(sender, args) {
   
    //  see if the table elements for the grids exist yet
    var isTab1Loaded = $get('<%# this.gvOrders.ClientID %>');
    var isTab2Loaded = $get('<%# this.gvEmployees.ClientID %>');

    //  if the tab does not exist and it is the active tab,
    //  trigger the async-postback
    if(!isTab1Loaded && sender.get_activeTabIndex() == 1){
        // load tab1
        __doPostBack('btnOrdersTrigger', '');
    }
    else if(!isTab2Loaded && sender.get_activeTabIndex() == 2){
        // load tab2
        __doPostBack('btnEmployeesTrigger', '');
    }          
}
</script>
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <shibashish:TabContainer ID="tabContainer" runat="server" ActiveTabIndex="0">
   <shibashish:TabPanel ID="shibatabpanel" runat="server" HeaderText="Customers">
        <ContentTemplate>
            <asp:ScriptManager ID="ScriptManager1" runat="server">
            </asp:ScriptManager>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                <ContentTemplate>                  
                    <asp:GridView ID="GridView1"
                        runat="server"
                        AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1"
                        AutoGenerateColumns="False" >
                    </asp:GridView>
                 
                 
                 
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                        ConnectionString="<%$ ConnectionStrings:PN_DBConnectionString4 %>"
                       
                        SelectCommand="SELECT [UserId], [MiddleName], [LastName], [Password], [FirstName], [Address] FROM [AddUser_tbl]">
                    </asp:SqlDataSource>
                </ContentTemplate>
            </asp:UpdatePanel>                                  
        </ContentTemplate>
    </shibashish:TabPanel>
    <shibashish:TabPanel ID="shiba1tabpanel" runat="server" HeaderText="Orders">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:GridView ID="GridView2"
                        runat="server"
                        AllowPaging="true" AllowSorting="true" PageSize="10" DataSourceID="SqlDataSource2" />
                </ContentTemplate>
            </asp:UpdatePanel>
        </ContentTemplate>
    </shibashish:TabPanel>
    <shibashish:TabPanel ID="shiba2tabPanel" runat="server" HeaderText="Employees">
        <ContentTemplate>
            <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                <ContentTemplate>                  
                    <asp:GridView ID="GridView3"
                        runat="server"
                        AllowPaging="true" AllowSorting="true" PageSize="10" DataSourceID="SqlDataSource3" />
                </ContentTemplate>
            </asp:UpdatePanel>
              <%--<asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnOrdersTrigger" />
    </Triggers>
    <ContentTemplate>
        <asp:GridView  ID="GridView4" runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource2" >
            <Columns>
                <asp:BoundField DataField="EmpCode" HeaderText="EmpCode"
                    SortExpression="EmpCode" />
                <asp:BoundField DataField="Country" HeaderText="Country"
                    SortExpression="Country" />
                <asp:BoundField DataField="PhoneNo" HeaderText="PhoneNo"
                    SortExpression="PhoneNo" />
                <asp:BoundField DataField="DateCreated" HeaderText="DateCreated"
                    SortExpression="DateCreated" />
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server"
            ConnectionString="<%$ ConnectionStrings:PN_DBConnectionString2 %>"
            SelectCommand="SELECT [EmpCode], [Country], [PhoneNo], [DateCreated] FROM [EmpDetails_tbl]">
        </asp:SqlDataSource>
    </ContentTemplate>
</asp:UpdatePanel>--%>                              
        </ContentTemplate>
    </shibashish:TabPanel>                              
        <shibashish:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel1">
        </shibashish:TabPanel>
</shibashish:TabContainer>
     
        <shibashish:DragPanelExtender ID="tabContainer_DragPanelExtender"
            runat="server" DragHandleID="tabContainer" Enabled="True"
            TargetControlID="tabContainer">
        </shibashish:DragPanelExtender>
     
        <shibashish:HoverMenuExtender ID="tabContainer_HoverMenuExtender"
            runat="server" DynamicServicePath="" Enabled="True"
            TargetControlID="UpdatePanel4" PopupControlID="Shibaname">
        </shibashish:HoverMenuExtender>
        <asp:Label ID="Shibaname" runat="server" Text="Created By Shibashish mohanty"
            ForeColor="#660033" Font-Size="XX-Large" Font-Bold="True" BackColor="Lime"></asp:Label>
    </div>
    <input id="btnOrdersTrigger" runat="server" type="button" style="display:none" onserverclick="BtnOrdersTrigger_Click" />

<asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="btnOrdersTrigger" />
    </Triggers>
    <ContentTemplate>
        <asp:GridView  ID="gvOrders"  runat="server" AutoGenerateColumns="False"
            DataSourceID="SqlDataSource2" >
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"
            ConnectionString="<%$ ConnectionStrings:PN_DBConnectionString %>"
            SelectCommand="SELECT * FROM [EmpDetails_tbl]">
        </asp:SqlDataSource>
    </ContentTemplate>
</asp:UpdatePanel>
<%--<shibashish:TabContainer ID="tabContainer1" runat="server" ActiveTabIndex="0" OnClientActiveTabChanged="clientActiveTabChanged" />
--%>
<asp:GridView ID="gvEmployees" runat="server" Visible="False"
        AutoGenerateColumns="False" DataSourceID="SqlDataSource3" >
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource3" runat="server"
        ConnectionString="<%$ ConnectionStrings:PN_DBConnectionString2 %>"
       
        SelectCommand="SELECT [ReceiptNo], [CompanyName], [Location], [CustomerName], [Amount] FROM [ErstBill_tbl]">
    </asp:SqlDataSource>
    </form>
</body>
</html>



in code part
------------

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void BtnOrdersTrigger_Click(object sender, EventArgs args)
    {
        this.gvOrders.Visible = true;
        this.gvOrders.DataBind();
    }
    protected void BtnEmployeesTrigger_Click(object sender, EventArgs args)
    {
        this.gvEmployees.Visible = true;
        this.gvEmployees.DataBind();
    }
}


No comments:

Post a Comment

Please don't spam, spam comments is not allowed here.

.

ShibashishMnty
shibashish mohanty