<%@ Page Title="" Language="VB" MasterPageFile="~/App_MasterPage/mpManager.master" AutoEventWireup="false" CodeFile="SiteSEO.aspx.vb" Inherits="Manager_WebSite_SiteSEO" %>
<%@ Register assembly="ControlPageing" namespace="ControlPageing" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="chpPageTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="chpHead" Runat="Server">
<style type="text/css">
.Fields span{ display:block; padding:0px 5px 0px 5px; float:left; cursor:pointer;border: 1px solid #777777; margin:2px; text-align:center; line-height:22px;}
</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="chpScript" Runat="Server">
<script type="text/javascript" src="/App_Themes/ManagerTheme/Js/jquery.min.js"></script> 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="chpTitle" Runat="Server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="chpContent" Runat="Server">
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View ID="View_Edit" runat="server">
        <script language="javascript" type="text/javascript">
            var txtID;
            $(document).ready(function() {
                $('#<%=imgSave.ClientID %>').bind('click', function() { EnCode(); });
                $('#<%=txtPageTitle.ClientID %>').bind('focus', function() { txtID = this.id; });
                $('#<%=txtKeyWords.ClientID %>').bind('focus', function() { txtID = this.id; });
                $('#<%=txtDescription.ClientID %>').bind('focus', function() { txtID = this.id; });
            });
            (function($) {
                $.fn.insertAtCaret = function(tagName) {
                    return this.each(function() {
                        if (document.selection) {
                            //IE support
                            this.focus();
                            sel = document.selection.createRange();
                            sel.text = tagName;
                            this.focus();
                        } else if (this.selectionStart || this.selectionStart == '0') {
                            //MOZILLA/NETSCAPE support
                            startPos = this.selectionStart;
                            endPos = this.selectionEnd;
                            scrollTop = this.scrollTop;
                            this.value = this.value.substring(0, startPos) + tagName + this.value.substring(endPos, this.value.length);
                            this.focus();
                            this.selectionStart = startPos + tagName.length;
                            this.selectionEnd = startPos + tagName.length;
                            this.scrollTop = scrollTop;
                        } else {
                            this.value += tagName;
                            this.focus();
                        }
                    });
                };
            })(jQuery);
            function EnCode() {
                $('#<%=txtPageTitle.ClientID %>').attr('value', encodeURI($('#<%=txtPageTitle.ClientID %>').attr('value')));
                $('#<%=txtKeyWords.ClientID %>').attr('value', encodeURI($('#<%=txtKeyWords.ClientID %>').attr('value')));
                $('#<%=txtDescription.ClientID %>').attr('value', encodeURI($('#<%=txtDescription.ClientID %>').attr('value')));
            }
            function InsertField(FieldName) {
                if (txtID != null && txtID != '') {
                    $('#' + txtID).insertAtCaret('<field name="' + FieldName + '" />');
                }
            }
        </script>
    	    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" class="line_table">
    	    <tr>
                    <td align="right" width="20%">SEO描述：</td>
                    <td width="30%">
                        <asp:TextBox ID="txtSEOName" runat="server"  Width="96%" ></asp:TextBox>
                    </td>
                    <td width="50%"><font color="red">*</font></td>
                </tr>	    
	    	<tr>
                    <td align="right" width="20%">绑定类型：</td>
                    <td width="30%">
                        <asp:DropDownList ID="dplBindType" runat="server" AutoPostBack="True" onchange="EnCode();">
                            <asp:ListItem Selected="True" Value="0">页面模板</asp:ListItem>
                            <asp:ListItem Value="1">SQL查询</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                    <td width="50%"><font color="red">*</font></td>
                </tr>	    	<tr>
                    <td align="right" width="20%">绑定序号：</td>
                    <td width="30%">
                        <asp:DropDownList ID="dplBindID" runat="server" AutoPostBack="True"  onchange="EnCode();">
                        </asp:DropDownList>
                    </td>
                    <td width="50%"><font color="red">*</font></td>
                </tr>
                <tr>
                    <td align="right" width="20%">&nbsp;</td>
                    <td width="80%" colspan="2">
                        <asp:Label ID="lblFields" runat="server" Text="" CssClass="Fields"></asp:Label>
                    </td>
                </tr>	    	
                <tr>
                    <td align="right" width="20%">页面标题：</td>
                    <td colspan="2" width="80%">
                        <asp:TextBox ID="txtPageTitle" runat="server" Height="63px" 
                            TextMode="MultiLine" Width="96%"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td align="right" width="20%">页面关键字：</td>
                    <td width="80%" colspan="2"><asp:TextBox ID="txtKeyWords" runat="server"  Width="96%" Height="69px" TextMode="MultiLine" ></asp:TextBox></td>
                </tr>	    	<tr>
                    <td align="right" width="20%">页面描述：</td>
                    <td colspan="2"><asp:TextBox ID="txtDescription" runat="server"  Width="96%" Height="126px" TextMode="MultiLine" ></asp:TextBox></td>
                </tr>                                                                                             	            
	    </table>   
<div style=" text-align:center"><asp:ImageButton ID="imgSave" runat="server" ImageUrl="~/App_Themes/ManagerTheme/Images/tj.jpg" style="height: 22px" ToolTip="添加" /></div>     
        </asp:View>
        <asp:View ID="View_List" runat="server">
    	    <div style="text-align: right;" class="edittd">
        	<asp:CheckBox ID="cbSelectAll" runat="server" AutoPostBack="True" Text="全部" />&nbsp;
        	<asp:LinkButton ID="lnkBtnDel" runat="server"><img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px"/>&nbsp;删除选中</asp:LinkButton>&nbsp;&nbsp;
        	<a href="/Manager/WebSite/SiteSEO.aspx?Action=Add"><img src="/App_Themes/ManagerTheme/Images/add.gif" style=" border:0px" />&nbsp;添加</a>
    	    </div>       
            <asp:Repeater ID="rptList" runat="server">
                <HeaderTemplate>
                    <table border="0" width="100%" id="table1" cellspacing="0" cellpadding="0" class="line_table">
			<tr>
			    <td width="5%" align="center" class="left_bt2">选择</td>
			    <td width="15%" align="center" class="left_bt2">绑定类型</td>
			    <td width="20%" align="center" class="left_bt2">绑定名称</td>
			    <td width="50%" align="center" class="left_bt2">SEO描述</td>
			    <td align="center" width="10%" class="left_bt2">操作</td>
			</tr>
	        </HeaderTemplate>
                <ItemTemplate>
                    <tr class="menuout"   onMouseOver="this.className='menuin'" onMouseOut="this.className='menuout'">
			<td width="5%" align="center"><asp:CheckBox ID="CheckOn" runat="server" ToolTip='<%#Eval("ID")%>' /></td>
			<td width="15%" align="center"><%#intTypeToStr(Eval("BindType"))%></td>
			<td width="20%" align="center"><%#intNameToStr(Eval("BindType"),Eval("BindID"))%></td>
			<td width="50%" align="center"><%#Eval("SEOName")%></td>
			<td width="10%" align="center"><a href="/Manager/WebSite/SiteSEO.aspx?Action=Edit&ID=<%#Eval("ID") %>">
				<img src="/App_Themes/ManagerTheme/Images/Edit.gif" style=" border:0px" />&nbsp;编辑</a>&nbsp;&nbsp;&nbsp;<a href="/Manager/WebSite/SiteSEO.aspx?Action=Del&ID=<%#Eval("ID") %>">
				<img src="/App_Themes/ManagerTheme/Images/Delete.gif" style=" border:0px" />&nbsp;删除</a></td>
			        </tr>
                </ItemTemplate>
                <FooterTemplate></table></FooterTemplate>
            </asp:Repeater>
            <div style="text-align:center"> <cc1:iPaging ID="ListPaging" runat="server" /></div>        
        </asp:View>        
    </asp:MultiView>
</asp:Content>