<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AddMenu.aspx.cs" Inherits="KstCMS.KstCMS_Manager.WebSet.WebMenu.AddMenu" %>

<html>
<head id="Head1" runat="server">
    <title>无标题页</title>

<script language="javascript" type="text/javascript">
    function onClickOutLink() {
        var chx = document.getElementById("chx_IsOutUrl");
     
        if (chx.checked) {
            document.getElementById("a1").style.display = "none";
            document.getElementById("txt_GoUrl").value = "http://";
        } else {
            document.getElementById("a1").style.display = "";
            document.getElementById("txt_GoUrl").value = "";
        }
    }

    function MycheckForm() {
        var chx = document.getElementById("chx_IsOutUrl");
        var ErrNum = 0;
        var ErrStr = "输入验证错误:\r\n";
        var frm = document.forms[0];
        if (frm.drp_SiteList.options[frm.drp_SiteList.selectedIndex].value == "0") {
            ErrNum++;
            ErrStr += ErrNum + ":您需要选择所属站点.\r\n";
        }
        if (BaseTrim(frm.txt_MenuName.value) == "") {
            ErrNum++;
            ErrStr += ErrNum + ":您需要输入导航名称.\r\n";
        }
        if (!chx.checked) {
            if (frm.txt_GoUrl.value == "") {
                ErrNum++;
                ErrStr += ErrNum + ":您需要输入导航链接的文件名称.\r\n";
            }
            if (BaseTrim(frm.txt_MateKey.value) == "") {
                ErrNum++;
                ErrStr += ErrNum + ":您需要输入Meta关键字.\r\n";
            }

//            if (BaseTrim(frm.txt_MateDesc.value) == "") {
//                ErrNum++;
//                ErrStr += ErrNum + ":您需要输入Meta注解.\r\n";
//            }

            if (BaseTrim(frm.txt_MenuDiy.value) == "") {
                ErrNum++;
                ErrStr += ErrNum + ":您需要输入导航链接目录.\r\n";
            }
            if (!checkIsLetterOrNumber(BaseTrim(frm.txt_MenuDiy.value))) {
                ErrNum++;
                ErrStr += ErrNum + ":输入的目录名必需是字母，数字或横线.\r\n";
            }

        }
        else {
            if (BaseTrim(frm.txt_GoUrl.value) == "") {
                ErrNum++;
                ErrStr += ErrNum + ":您需要输入外部链接的网址.\r\n";
            }
            if (!IsURL(BaseTrim(frm.txt_GoUrl.value))) {
                ErrNum++;
                ErrStr += ErrNum + ":输入的外部链接网址不是有效的网址格式.\r\n";
            }

        }

        if (!checkIsInteger(frm.txt_SortNo.value)) {
            ErrNum++;
            ErrStr += ErrNum + ":排序必需输入数字.\r\n";
        }
/*
        if (frm.drp_TempList.options[frm.drp_TempList.selectedIndex].value == "0") {
            ErrNum++;
            ErrStr += ErrNum + ":您需要选择模板.\r\n";
        }
*/
        if (ErrNum > 0) {
            alert(ErrStr);
            return false;
        } 
           return true;


    }




</script>
</head>
<body>

    <form id="form1" runat="server">

    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>

    <div class="MainBox">
      <table class="PageTitle" width="98%"><tr><td>
       <img src="<%=SysRootUrl %>/KstCMS_Manager/images/sms_type13.gif" align="absmiddle" /> <b> 增加导航</b> </td></tr></table>
         <table width="98%" border="0" cellspacing="0" cellpadding="5">


        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td width="8%" nowrap class="Line">所属站点：</td>
          <td width="92%" class="Line">
              <asp:DropDownList ID="drp_SiteList" runat="server" AutoPostBack="true">
              </asp:DropDownList>
          </td>
        </tr>
        
        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">导航名称：</td>
          <td class="Line">
              <asp:TextBox ID="txt_MenuName" runat="server" MaxLength="50" CssClass="input_text"></asp:TextBox> <span class="Red">*</span></td>
        </tr>
        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">首页文件：</td>
          <td class="Line">
              <asp:TextBox ID="txt_GoUrl" runat="server" MaxLength="255" CssClass="input_text" Text="index"></asp:TextBox> <span class="Red">*</span>导航首页
              <asp:CheckBox ID="chx_IsOutUrl" runat="server" /> 外部链接</td>
        </tr>

        <tbody id="a1">
        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">Meta关键字：</td>
          <td class="Line">
             <asp:TextBox ID="txt_MateKey" runat="server" TextMode="MultiLine" Rows="3" Width="500" ></asp:TextBox> <span class="Red">*</span>
          </td>
        </tr>

        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">Meta注解：</td>
          <td class="Line">
             <asp:TextBox ID="txt_MateDesc" runat="server" TextMode="MultiLine" Rows="3" Width="500" ></asp:TextBox> 
          </td>
        </tr>

        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">文件目录：</td>
          <td class="Line">
              <asp:TextBox ID="txt_MenuDiy" runat="server" MaxLength="50" CssClass="input_text"></asp:TextBox> <span class="Red">*</span></td>
        </tr>



        <!--
         <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">邦定下属栏目：</td>
          <td class="Line">
              <asp:DropDownList ID="drp_GoLmID" runat="server">
              </asp:DropDownList>
              </td>
        </tr>
        -->
        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">导航属性：</td>
          <td class="Line">
              <asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatColumns="6">
               <asp:ListItem Value="0" Text="单页" Selected="True"></asp:ListItem>
               <asp:ListItem Value="1" Text="产品"></asp:ListItem>
               <asp:ListItem Value="2" Text="文章"></asp:ListItem>
               <asp:ListItem Value="3" Text="图片"></asp:ListItem>
               <asp:ListItem Value="4" Text="下载"></asp:ListItem>
               <asp:ListItem Value="5" Text="其它"></asp:ListItem>
              </asp:RadioButtonList>
          </td>
        </tr>
        </tbody>
        <tr class="Linetr1" onMouseOver="this.className='Linetr2';" onMouseOut="this.className='Linetr1';">
          <td nowrap class="Line">相关选项：</td>
          <td class="Line">
           启用导航 <asp:CheckBox ID="chx_Act" runat="server" Checked="true" /> 
           显示导航 <asp:CheckBox ID="chx_IsShow" runat="server"  Checked="true" /> 
           排序 <asp:TextBox ID="txt_SortNo" runat="server" Width="30" CssClass="input_text"></asp:TextBox>
           选择模板：<asp:DropDownList ID="drp_TempList" runat="server">
              </asp:DropDownList>
          
          </td>
        </tr>
        <tr class="Linetr1" >
          <td nowrap class="Line">&nbsp;</td>
          <td nowrap class="Line">
              <asp:Button ID="OkBtn" runat="server" Text=" 确 定 " CssClass="bigButton" OnClientClick="return MycheckForm();" />
              <input type="button" value="返回" class="bigButton" onclick="history.go(-1);" />
              </td>
        </tr>
        

        
        </table>

       
       
    </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
    <ProgressTemplate>正在处理中，请稍候...</ProgressTemplate>
    </asp:UpdateProgress>
    </form>

</body>
</html>