<%@ Page Title="" Language="C#" MasterPageFile="~/Management/SiteManage.Master" AutoEventWireup="true" CodeBehind="UrlEncodingRule.aspx.cs" Inherits="BingoWebsiteCollector.Web.Management.UrlEncodingRule" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="right" style="text-align: center; margin-top: 10px;">
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        网址转换规则设置</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                            <table width="100%" border="0" cellspacing="1" cellpadding="1" class="table_list">
                                <tr class="tr1">
                                    <td colspan="2">
                                        <asp:Label ID="laTitle" runat="server" Text="添加网址转换规则"></asp:Label><br />
                                        <asp:Label ID="laErrorInfo" runat="server" ForeColor="Red"></asp:Label>
                                        <asp:Label ID="laSuccessInfo" runat="server" ForeColor="Green"></asp:Label>
                                    </td>
                                        </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            规则应用标签<font color="red">*</font>：</div></td>
                                    <td align="left">
                                        <validation targetid="<%=tbTagName.ClientID%>" targetname="标签名" type="text" />
                                                    <asp:TextBox ID="tbTagName" runat="server" Width="80" 
                                            Wrap="False" />
                                                    请指定规则应用的标签，比如说对方网站有延迟加载，在img标签上有一个lazy_load 属性 如&lt;img src=&quot;http://&quot; 
                                        lazy_load=&quot;http://&quot; /&gt;, 那么此处的标签就是img。</td>
                                        </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            标签属性<font color="red">*</font>：</div></td>
                                    <td align="left">
                                        <validation targetid="<%=tbAttributeName.ClientID%>" targetname="标签属性" type="text" />
                                                    <asp:TextBox ID="tbAttributeName" runat="server" Width="80" 
                                            Wrap="False" />
                                                    如&lt;img src=&quot;http://&quot; lazy_load=&quot;http://&quot; 
                                        /&gt;，想要对lazy_load属性进行url转换，那么此处就填写lazy_load。</td>
                                        </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            默认扩展名<font color="red">*</font>：</div></td>
                                    <td align="left">
                                        <validation targetid="<%=tbDefaultFileType.ClientID%>" targetname="默认扩展名" type="text" />
                                                    <asp:TextBox ID="tbDefaultFileType" runat="server" Width="80" 
                                            Wrap="False" />
                                                    在静态化的时候，请指定一个默认的扩展名，比如，你编码的是一个网页，那么可以用html，如果是图片，可以用png，这是为了在没有扩展名的情况下静态化</td>
                                        </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            优先级：</div>
                                    </td>
                                    <td align="left">
                                                    <asp:TextBox ID="tbPriority" runat="server" Width="80" Wrap="False" >10</asp:TextBox>
                                                    请指定优先级，优先级高的规则先生效，数字越小代表优先级越高。
                                                    <validation targetid="<%=tbPriority.ClientID%>" targetname="优先级" type="number" />
                                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div align="right">
                                            选项：</div>
                                    </td>
                                    <td align="left">
                                        <asp:CheckBox ID="cbIsEnable" CssClass="checkbox" runat="server" 
                                            Text="是否激活" Checked="True" />
                                        <asp:CheckBox ID="cbKeepOriginalFileType" CssClass="checkbox" runat="server" 
                                            Text="是否保持原有扩展名" /><br />
                                            保持原有扩展名，比如原本是一个gif图片，在编码模式下，会自动保存成gif扩展名的静态文件，指定此属性，则会覆盖默认扩展名
                                        </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <asp:LinkButton ID="lbSubmit" runat="server" 
                                            Text="【提交】" onclick="lbSubmit_Click"  OnClientClick="return validateForm()" />
                                        &nbsp;<asp:LinkButton ID="lbCancel" runat="server" Text="【取消】" onclick="lbCancel_Click"/>
                                    </td>
                                </tr>
                            </table>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear">
    </div>
        <div class="right" style="text-align: center; margin-top: 10px;">
        <div class="clear">
        </div>
        <table width="100%" border="0" cellspacing="1" cellpadding="1" class="edit">
            <tr>
                <td class="title_edit">
                    <h1 style="float: left">
                        网址转换规则列表</h1>
                </td>
            </tr>
            <tr>
                <td class="edit_main">
                    <asp:GridView ID="gvUrlEncodingRules" runat="server" AutoGenerateColumns="False" 
                        GridLines="None" CssClass="table_list" Width="100%" 
                        EnableModelValidation="True">
                        <Columns>
                            <asp:TemplateField HeaderText="操作" ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbEdit" runat="server" CausesValidation="False"
                                        Text="【编辑】" CommandArgument='<%# Bind("RuleId") %>' onclick="lbEdit_Click"></asp:LinkButton>
                                    &nbsp;<asp:LinkButton ID="lbDelete" runat="server" CausesValidation="False" CommandArgument='<%# Bind("RuleId") %>'
                                        Text="【删除】" onclick="lbDelete_Click" OnClientClick="if(confirm('确认删除记录?')){eval(this.attributes['href'].value)}else{return false}"></asp:LinkButton>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="RuleId" HeaderText="编号" 
                                SortExpression="RuleId" />
                            <asp:BoundField DataField="Priority" HeaderText="优先级" />
                        <asp:CheckBoxField DataField="IsEnable" HeaderText="是否激活" SortExpression="IsEnable" />
                            <asp:BoundField DataField="TagName" HeaderText="标签名" />
                            <asp:BoundField DataField="AttributeName" HeaderText="属性名" />
                        </Columns>
                        <HeaderStyle CssClass="tr1" />
                        <RowStyle CssClass="tr_a" />
                        <AlternatingRowStyle CssClass="tr_b" />
                        <FooterStyle CssClass="dg_header" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    <div class="clear" style="margin-top: 10px;">
    </div>
</asp:Content>
