<%@ page language="C#" autoeventwireup="true" inherits="Admin_PageInfo_Operate, GroupTGWeb_deploy" %>

<%@ Register Src="UserControl/MessageShow.ascx" TagName="MessageShow" TagPrefix="uc1" %>
<!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 type="text/css" rel="Stylesheet" href="css/index.css" />

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

    <script type="text/javascript" language="javascript">
        function ad(str) {
            if(str.length >0)
            {
                var tc = document.getElementById("TextBoxContent");
                var tclen = tc.value.length;
                tc.focus();
                if(typeof document.selection != "undefined") {
                    document.selection.createRange().text = str;
                }
                else {
                    tc.value = tc.value.substr(0, tc.selectionStart) + str + tc.value.substring(tc.selectionStart,tclen);
                } 
            }
        }
        
        function CallServer2()
        {
            context = "";
            arg = "GetstrAd";
            <%= ClientScript.GetCallbackEventReference(this, "arg", "ReceiveServerData2", "context")%>;
        }
        
        function ReceiveServerData2(result, context)
        {
            var strs=result.split('|');
            
            var hid = document.getElementById("HiddenFieldADCount");
            
            if(hid.value =="0")
            {
                hid.value=strs[1];
            
                ad(strs[0]);
            }
            else
            {
                alert('每次只能添加一条数据！');
            }
        }
    </script>

</head>
<body style="padding: 0; background-image: url(images/Bg_right.gif); background-repeat: repeat;
    font-size: 12px">
    <form id="form1" runat="server">
    <div class="navigator">
        <asp:Label ID="LabelPageTitle" runat="server" Text="【 添加广告位】"></asp:Label></div>
    <table cellpadding="0" cellspacing="0" border="0" style="width: 100%; line-height: 30px;">
        <tr>
            <td align="right" width="20%">
                页面名：
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxPageName" runat="server" Width="200"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right">
                文件名：
            </td>
            <td align="left">
                <asp:DropDownList ID="DropDownListFileName" runat="server" AutoPostBack="true" OnSelectedIndexChanged="DropDownListFileName_SelectedIndexChanged"
                    Width="200">
                </asp:DropDownList>
                <asp:Label ID="Label2" runat="server" Text="*" ForeColor="red"></asp:Label>
                <asp:CompareValidator ID="CompareFatherCateGory" runat="server" ControlToValidate="DropDownListFileName"
                    Display="Dynamic" ErrorMessage="该值必需选择" Operator="NotEqual" ValueToCompare="-1"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td align="right">
                说明：
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxPageNote" runat="server" Width="200"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right">
                代码：
            </td>
            <td align="left">
                <asp:TextBox ID="TextBoxContent" runat="server" TextMode="MultiLine" Height="400px"
                    Width="500px" CssClass="input1"></asp:TextBox>
            </td>
        </tr>
    </table>
    <br />
    <div style="background-color: #EEEEEE; height: 22px" class="btconfig">
        <table cellpadding="0" cellspacing="0" border="0" width="100%">
            <tr>
                <td align="right" width="20%">
                </td>
                <td align="left">
                    <asp:Button ID="ButtonConfirm" runat="server" Text="确定" CssClass="bt2" OnClick="ButtonConfirm_Click" />
                    <input id="ButtonAdd" type="button" value="添加广告位" class="bt3" onclick="CallServer2()" />
                    <input id="inputReset" type="reset" value="重置" class="bt2" />
                    <asp:Button ID="ButtonBack" runat="server" Text="返回列表" CssClass="bt3" CausesValidation="false"
                        OnClick="ButtonBack_Click" />
                    <uc1:MessageShow ID="MessageShow" runat="server" Visible="False" />
                </td>
            </tr>
        </table>
    </div>
    <asp:HiddenField ID="hiddenFieldGuid" runat="server" Value="0" />
    <asp:HiddenField ID="HiddenFieldADCount" runat="server" Value="0" />
    <asp:HiddenField ID="HiddenFieldADGuid" runat="server" Value="0" />
    </form>
</body>
</html>
