<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Admin/AdminMain.Master" Inherits="System.Web.Mvc.ViewPage<MvcEnterprise.Models.DataSet1+FriendSiteRow>" %>

<asp:Content ID="Content0" ContentPlaceHolderID="HeadContent" runat="server">
    <script src="../../Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="../../Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery-1.3.2.min.js" type="text/javascript"></script>
    <script src="../../Scripts/Admin.js" type="text/javascript"></script>
    <script src="<%=Url.Content("~/Content/fckeditor/fckeditor.js")%>" type="text/javascript"></script>
    <%Html.EnableClientValidation(); %>
    <%
        //文字链接去掉"浏览"按钮
        if (!Model.LinkType)
      { %>
    <script type="text/javascript">
        $(function() {
            $("input[value='浏览']").hide();
        });
    </script>
    <%} %>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    编辑内容
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div>
        <%= Html.ActionLink("返回列表","FriendSiteList") %></div>
    <hr />
    <% using (Html.BeginForm())
       {%>
    <div>
        <%--网站名称--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.SiteName) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.SiteName) %><%= Html.DisplayToolTipFor(model => model.SiteName) %><%= Html.ValidationMessageFor(model => model.SiteName) %></span>
        <%--是否显示--%>
        <span><%= Html.LabelFor(model => model.ViewFlag) %>：<%= Html.CheckBoxFor(model => model.ViewFlag) %> <%= Html.DisplayToolTipFor(model => model.ViewFlag) %></span></div>
    <div>
        <%--显示顺序--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.Sequence) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.Sequence)%> <%= Html.DisplayToolTipFor(model => model.Sequence) %>
            <%= Html.ValidationMessageFor(model => model.Sequence)%></span>
    </div>
    <div>
        <%--链接类型--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.LinkType) %>：</span>
        <span class="editor-field">
        <label><%= Html.RadioButtonFor(m => m.LinkType, true, new { onclick = "$('#editor-Remark').show();" })%>图片</label>
        <label><%= Html.RadioButtonFor(m => m.LinkType, false, new { onclick = "$('#editor-Remark').hide();" })%>文字</label>
        <%= Html.DisplayToolTipFor(model => model.LinkType) %><%= Html.ValidationMessageFor(model => model.LinkType) %>
        </span></div>
    <div id="editor-Remark" style="display:<%=!Model.LinkType ? "none":"block"%>">
        <%--图片地址--%>
        <span class="editor-label"><%= Html.LabelFor(m=>m.Remark) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFileUrlFor(model => model.Remark) %><%= Html.DisplayToolTipFor(model => model.Remark) %><%= Html.ValidationMessageFor(model => model.Remark) %></span></div>
    <div>
        <%--链接地址--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.SiteUrl) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.SiteUrl) %><%= Html.DisplayToolTipFor(model => model.SiteUrl) %><%= Html.ValidationMessageFor(model => model.SiteUrl) %></span></div>
    <div>
        <%--点击次数--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.ClickNumber) %>：</span>
        <span class="editor-field"><%= Html.TextBoxFor(model => model.ClickNumber, new { value = 0}) %><%= Html.DisplayToolTipFor(model => model.ClickNumber) %><%= Html.ValidationMessageFor(model => model.ClickNumber) %></span></div>
    <div>
        <%--添加时间--%>
        <span class="editor-label"><%= Html.LabelFor(model => model.AddTime) %>：</span>
        <span class="editor-field"><%= Html.TextBoxCalendarFor(model => model.AddTime, new { style = "width:140px" }) %><%= Html.DisplayToolTipFor(model => model.AddTime) %><%= Html.ValidationMessageFor(model => model.AddTime) %></span></div>
    <div>
        <%----%><%= Html.HiddenFor(model=>model.ID) %></div>
    <p><input type="submit" value="保 存" /> </p>
    <% } %>
</asp:Content>

