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

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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>

    <script type="text/javascript">
        function ShowMessage() {
            var win = GetRadWindowManager().GetWindowByName("Message");
            win.SetUrl("Default2.aspx");
            win.SetSize(600, 430);
            win.Show();
        } 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:GridView ID="gvMessages" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            DataKeyNames="CategoryID" DataSourceID="SqlDataSource1">
            <PagerSettings Mode="NextPreviousFirstLast" />
            <Columns>
                <asp:BoundField DataField="CategoryID" HeaderText="CategoryID" InsertVisible="False"
                    ReadOnly="True" SortExpression="CategoryID" />
                <asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
                <asp:TemplateField>
                    <ItemTemplate>
                        <div id="divMessageTitle" style="overflow: hidden; width: 150px; text-overflow: ellipsis"
                            wrap>
                            <asp:Literal ID="ltMessageTitle" runat="server" Text='<%# Eval("CategoryName") %>'></asp:Literal>
                        </div>
                        <a href='#' style="font-size: 10px" onclick="ShowMessage();">[more]</a>
                        <br />
                        <br />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT * FROM [Categories]"></asp:SqlDataSource>
        <asp:Button ID="ltContent" Text="Button" OnClientClick="ShowMessage()" runat="server">
        </asp:Button>
        <telerik:RadWindowManager ID="Singleton" runat="server" Skin="Outlook">
            <Windows>
                <telerik:RadWindow ID="Message" runat="server" Modal="True" Behavior="Close" />
            </Windows>
        </telerik:RadWindowManager>
    </div>
    </form>
</body>
</html>
