<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FriendLinkCheck.aspx.cs"
    Inherits="TopWinCMS.WebUI.Admin.FriendLink.FriendLinkCheck" %>

<!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>
    <link href="../Style.css" type="text/css" rel="stylesheet" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Pragma" content="No-cach" />

    <script language="javascript" type="text/javascript" src="../../Images/skysoft.js"></script>

    <script language="javascript" type="text/javascript" src="../../JS/Ajax/Ajax.js"></script>

    <script language="javascript" type="text/javascript">
        function check(type, checkurl, o)
        {
            var Ajax = new AjaxClass();
            Ajax.RequestUrl = "FriendLinkAJAX.ashx?Action=" + type + "&URL=" + checkurl + "&m=" + Math.random(); ;
            Ajax.Method = "get";
            Ajax.IsAsyn = true;
            Ajax.StateChangeEvent = function()
            {
                if (Ajax.XmlHttp.readyState == 4)
                {
                    if (Ajax.XmlHttp.status == 200)
                    {
                        var rev = Ajax.XmlHttp.responseText;
                      
                            document.getElementById(o).innerHTML = Ajax.XmlHttp.responseText;
                       
                    }
                    else
                    {
                        alert("服务器连接失败。错误代码为：[" + Ajax.XmlHttp.status + "]," + Ajax.XmlHttp.statusText);
                    }
                }
            };
            Ajax.SendRequest();
        }
 
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <asp:TextBox ID="TB_URL" runat="server" Width="271px"></asp:TextBox>
    <asp:Button ID="BT_OK" runat="server" CssClass="btn" Text="分析" OnClick="BT_OK_Click" />
    <asp:GridView ID="GV_List" runat="server" AutoGenerateColumns="False" DataKeyNames="ID">
        <Columns>
            <asp:BoundField DataField="FL_Title" HeaderText="网站名称">
                <ItemStyle Width="80px" />
            </asp:BoundField>
            <asp:BoundField DataField="FL_URL" HeaderText="网址" />
            <asp:TemplateField HeaderText="分析">
                <ItemTemplate>
                    <span id="sp_Link_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Link', '<%# Eval("FL_URL") %>', 'sp_Link_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="80px" HorizontalAlign="Center" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="百度收录">
                <ItemTemplate>
                    <span id="sp_Baidu_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Baidu', '<%# Eval("FL_URL") %>', 'sp_Baidu_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" Width="60px" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="谷歌收录">
                <ItemTemplate>
                    <span id="sp_Google_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Google', '<%# Eval("FL_URL") %>', 'sp_Google_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle HorizontalAlign="Right" Width="60px" />
            </asp:TemplateField>
          
            <asp:TemplateField HeaderText="Alexa">
                <ItemTemplate>
                    <span id="sp_Alexa_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Alexa', '<%# Eval("FL_URL") %>', 'sp_Alexa_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Yahoo">
                <ItemTemplate>
                    <span id="sp_Yahoo_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('Yahoo', '<%# Eval("FL_URL") %>', 'sp_Yahoo_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SoGou">
                <ItemTemplate>
                    <span id="sp_SoGou_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('SoGou', '<%# Eval("FL_URL") %>', 'sp_SoGou_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="SoSo">
                <ItemTemplate>
                    <span id="sp_SoSo_<%# Eval("ID") %>">正在分析</span>

                    <script type="text/javascript">                        check('SoSo', '<%# Eval("FL_URL") %>', 'sp_SoSo_<%# Eval("ID") %>')</script>

                </ItemTemplate>
                <ItemStyle Width="60px" HorizontalAlign="Right" />
            </asp:TemplateField>
        </Columns>
        <HeaderStyle CssClass="HeaderStyle" />
    </asp:GridView>
    </form>
</body>
</html>
