<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm.aspx.cs" EnableEventValidation="false"
    ValidateRequest="false" Inherits="PowerEasy.Module.General.WebSite.WebForm" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加自定义表单数据</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="SmContent" runat="server" ScriptMode="Release" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <pe:extendedrepeater id="RepModel" runat="server" onitemdatabound="RepModel_OnItemDataBound">
                <ItemTemplate>
                    <tr id='Tab' runat="server" class='tdbg'>
                        <td class='tdbgleft' align='right' style="width: 20%;">
                            <div class="DivWordBreak">
                                <strong>
                                    <%# Eval("FieldAlias")%>
                                    ：&nbsp;</strong><br />
                                <%# Eval("Tips") %>
                            </div>
                        </td>
                        <td class='tdbg' align='left'>
                            <pe:FieldControl ID="Field" runat="server" EnableNull='<%# (bool)Eval("EnableNull") %>'
                                FieldAlias='<%# Eval("FieldAlias")%>' Tips='<%# Eval("Tips") %>' FieldName='<%#Eval("FieldName")%>'
                                ControlType='<%# Eval("FieldType") %>' FieldLevel='<%# Eval("FieldLevel") %>' ModelId='<%# Eval("ModelId") %>'
                                Description='<%# Eval("Description")%>' Settings='<%# ((PowerEasy.Module.General.Model.CommonModel.FieldInfo)Container.DataItem).Settings %>'
                                Value='<%# Eval("DefaultValue") %>' IsAdminManage="false">
                            </pe:FieldControl>
                        </td>
                    </tr>
                </ItemTemplate>
            </pe:extendedrepeater>
        </table>
        <div class="ok_bottom">
         验证码：<asp:TextBox ID="TxtValCode" runat="server" CssClass="inputtext" MaxLength="6"
                Width="60" onfocus="this.select();Refresh();"></asp:TextBox><img id="VcodeComplaints"
                    title="看不清楚，换一个" onclick="refreshValidateCodeImage(this);" src="<%= BasePath %>Controls/ValidateCodeImage.aspx"
                    align="absmiddle" style="border-width: 0px; cursor: pointer;" />
            <pe:alternatebutton id="BtnSubmit" runat="server" CssClass="submit_button_six" text="提交表单" alternatetext="修改表单"
                onclientclick="if(!CheckCode()){return false;}" onclick="BtnSubmit_Click" />
        </div>
    </div>
    <script type="text/javascript">
        var nodeIdClientId = "";
        function refreshValidateCodeImage(ValidateCodeImageControl) {
            ValidateCodeImageControl.src = ValidateCodeImageControl.src + '?code=' + randomNum(10);
        }
        function randomNum(n) {
            var rnd = '';
            for (var i = 0; i < n; i++)
                rnd += Math.floor(Math.random() * 10);
            return rnd;
        }
        function Refresh() {
            jQuery("#VcodeComplaints").click();
        }
        function CheckCode() {
            if (jQuery("#<%= TxtValCode.ClientID %>").get(0).value == "") {
                alert("请输入验证码");
                return false;
            }
            return true;
        }
    </script>
    </form>
</body>
</html>
