<%@ Page Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="ADadd.aspx.cs" Inherits="Mvcb2b.admin.ADadd" Title="广告添加" ValidateRequest="false" %>
<%@ MasterType VirtualPath="Admin.Master" %>
<%@ Register src="controls/Upsmall.ascx" tagname="Upsmall" tagprefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript">
    var editorpath = "<%=Webd()%>editors/";
    function checkform() {
        if (typeof (Page_ClientValidate) == 'function') {

        }
    }
    $(document).ready(function () {
        $("#<%=typeid_txt.ClientID%>").change(function () {
            var value = $(this).val();
            Getwidth(value);
        });
    });

    function Getwidth(type) {
        $.ajax({
            type: "POST",
            url: "jquery/getadtypewidth.aspx",
            dataType: "text",
            data: { "type": "" + type + "" }, //p传输的参数
            success: function (text) {
                if (text != "") {
                    var arr = text.split(",");
                    if (arr.length > 0) {
                        document.getElementById("typewidthdes").innerHTML = "（宽：" + arr[0] + "px，高：" + arr[1] + "px）";
                        $("#<%=adwidth_txt.ClientID%>").val(arr[0]);
                        $("#<%=adheight_txt.ClientID%>").val(arr[1]);
                    }
                }
            }, error: function (html) { alert("没有权限!"); }
        });

    }
</script>
<div class="path">当前位置： 广告管理 >>  广告添加</div>
<h3><asp:Literal  ID="Literal1" runat="server"></asp:Literal></h3>

<table width="92%" border="0" class="editor" align="center" style="background-color:#f5f5f5;" cellpadding="3" cellspacing="1">     
<tr><td width="120" align="right"><span style="color: Red">*</span>广告标题：</td>
<td><asp:TextBox ID="adtitle_txt" runat="server" Text="" Width="260px"></asp:TextBox> <span style="color:#ccc;">&nbsp; *为必填</span> 
<asp:RequiredFieldValidator ID="RequiredFieldValidator1"   runat="server" ErrorMessage="广告标题不能为空"  Display="None" ControlToValidate="adtitle_txt" ValidationGroup="Haosubmit"></asp:RequiredFieldValidator>
</td></tr>   
<tr><td  align="right"><span style="color: Red">*</span>广告说明：</td>
<td><asp:TextBox ID="addes_txt"  runat="server" Text="" Width="260px" Height="60px" TextMode="MultiLine"></asp:TextBox>  
</td></tr>   
<tr><td align="right">广告位置：</td><td><asp:dropdownlist id="typeid_txt"  runat="server"  >	
									<asp:ListItem Value="">请选择</asp:ListItem>									
								</asp:dropdownlist> <span class="blue" id="typewidthdes"><asp:Literal ID="typedes_txt"  runat="server"></asp:Literal></span></td></tr>
<tr><td align="right">宽：</td><td><asp:TextBox ID="adwidth_txt" runat="server" Text="" Width="50px"></asp:TextBox>px
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="广告宽度不能为空" Display="None" ControlToValidate="adwidth_txt"></asp:RequiredFieldValidator>
<asp:comparevalidator id="comparevalidator2" runat="server" ErrorMessage="广告宽度只能为数字!" ControlToValidate="adwidth_txt" Display="None" Type="Integer" Operator="DataTypeCheck"></asp:comparevalidator>
</td></tr> 
<tr><td align="right">高：</td><td><asp:TextBox ID="adheight_txt" runat="server" Text="" Width="50px"></asp:TextBox>px
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="广告高度不能为空" Display="None" ControlToValidate="adheight_txt"></asp:RequiredFieldValidator>
<asp:comparevalidator id="comparevalidator1" runat="server" ErrorMessage="广告高度只能为数字!" ControlToValidate="adheight_txt" Display="None" Type="Integer" Operator="DataTypeCheck"></asp:comparevalidator>
</td></tr> 
<tr><td align="right">广告链接：</td><td><asp:TextBox ID="adlink_txt" runat="server" Text="http://" Width="180px"></asp:TextBox></td></tr>
<tr>
  <td align="right">广告文件：</td>
  <td><uc3:Upsmall ID="Upsmall1" runat="server" /></td>
</tr><%--picsmall_txt 对应 adfile--%>
<tr><td colspan="2" align="center"><asp:HiddenField ID="action_txt" runat="server" /><asp:HiddenField ID="id_txt" runat="server" />
    <asp:Button ID="Add" runat="server" Text="添加" Width="58px"  ValidationGroup="Haosubmit" onclick="Add_Click" />&nbsp;<asp:Button ID="Edit" runat="server" Text="修改"  Width="58px" TabIndex="10" ValidationGroup="Haosubmit"   ></asp:Button>&nbsp;<asp:validationsummary id="ValidationSummary1"  runat="server" ShowMessageBox="True" ShowSummary="False"  ValidationGroup="Haosubmit"></asp:validationsummary> <input type="button" value="返回" name="go" style="width:58px;" onclick="javascript:history.go(-1);"  /></td></tr>
</table>
</asp:Content>
