<%@ page language="VB" masterpagefile="~/Page.master" autoeventwireup="false" inherits="WebExam.Web.secure_edituserinfo, App_Web_plxe2zxg" title="编辑用户信息" %>
<%@ MasterType VirtualPath="~/Page.master" %>
<asp:Content ID="head" ContentPlaceHolderID="ContentHead" runat="Server">
    <link rel="stylesheet" href="../../style/selfreg.css" type="text/css" />
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="mainCopy" runat="Server">
   <script type="text/javascript">
       function confirmdel() {
           if (confirm("确实要删除该行吗?"))
               return true
           else
               return false


       }

    function localView() {
     //var userform=document.forms[0]; 
     var pathInput=document.getElementById("<%= Fpath.ClientId() %>");
 var pf =pathInput.value
 if(pf!="")
 {
  
  var re = /\.[^\.]+$/;
 
  var r = pf.search(re);
  var att=pf.substring(r).toLowerCase()
  var imgHtml="<img name='imageViewC' title='照片预览' src='"+pf+ "'>";
  

  switch(att){
   
    case".jpg":
      
      view.innerHTML =imgHtml;
 
      break
   
   default:
      
      alert("仅允许.jpg格式的图片。");
     
      break
  }

  
  
 }
 
 //var t=window.open("","n") 
 //t.document.write(flashHtml)
} 
function window.onload() {

document.getElementById("serverView").src="../../data/usersphoto/"+document.getElementById("<%= L_userId.ClientId()%>").innerText +".jpg?"+Math.random();
   
}

    </script>
   
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="True" EnableScriptGlobalization="True">
    </asp:ScriptManager>

   
        <ul class="clear">
            <li class="clear">
                <p class="creat fleft clear">
                    编辑用户信息</p>
            </li>
         
            <li class="clear">
                <div class="name_list font_space fleft">
                    用户名：</div>
                <div class="input_list font_space fleft">
                    <asp:Label ID="L_userId" runat="server" class="name_aready"></asp:Label>
                </div>
                <div class="explain_list fleft">
                    <span id="messageDiv" class="explain"></span>
                </div>
            </li>
            <li class="clear">
                <div class="compart">
                </div>
            </li>
            <li class="clear">
            <p class="creat fleft clear">
                    用户角色</p>
               
            </li>
            <li class="clear">
                <div class="name_list font_space fleft">
        </div>
                <div class="input_list font_space fleft">

    <asp:GridView ID="GV_roles" runat="server" AutoGenerateColumns="False" CellPadding="4"
            GridLines="None" EnableModelValidation="True" ForeColor="#333333">
            <EditRowStyle BackColor="#999999" />
            <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Left" />
            <Columns>
                <asp:TemplateField Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="L_roleData" runat="server" Text="<%# Container.dataItem.role %>"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="L_rangeData" runat="server" Text="<%# Container.dataItem.range %>"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="角色">
                    <ItemTemplate>
                        <asp:Label ID="L_role" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="授权范围">
                    <ItemTemplate>
                        <asp:Label ID="L_range" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:CommandField ShowDeleteButton="True" />
                
            </Columns>
            <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        </asp:GridView>
      

                </div>
            </li>



            <li class="clear">
                <p class="creat fleft clear">
                    个人资料</p>
            </li>
            
            <li class="clear">
                    <div class="name_list font_space fleft">
                        <span class="atten"></span> 照 片：</div>
                    <div class="input_list font_space fleft">
                        <table>
                            <tr>
                                <td id="view">
                                    <img id="serverView" height="200" width="150" onerror="this.src='../../data/usersphoto/nophoto.gif'" src="../../data/usersphoto/nophoto.gif" alt="my photo" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:FileUpload ID="Fpath" runat="server" />
                            
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div class="explain_list fleft">
                        <span class="explain">照片要求：宽150像素，高200像素，jpg格式，文件大小小于50K</span></div>
                </li>
            
            
            
            
            
            <li class="clear">
                <div class="name_list font_space fleft">
                    <span class="atten">*</span> 姓 名：</div>
                <div class="input_list font_space fleft">
                    <asp:TextBox ID="TB_userName" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                        onfocus="this.style.borderColor='#99E300';" AutoCompleteType="Disabled"></asp:TextBox>
                    <div class="error_explain font_space">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator20" runat="server" ErrorMessage="请输入姓名"
                            ControlToValidate="TB_userName" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                </div>
            </li>
            <li class="clear">
                <div class="name_list font_space fleft">
                    <span class="atten">*</span> 性 别：</div>
                <div class="input_list font_space fleft">
                    <asp:RadioButtonList ID="gender" runat="server" BorderStyle="none" Style="border: 0px"
                        RepeatDirection="Horizontal" BorderWidth="0" RepeatLayout="Flow">
                        <asp:ListItem Text="男  " Value="1"></asp:ListItem>
                        <asp:ListItem Text="女" Value="0"></asp:ListItem>
                    </asp:RadioButtonList>
                    <div class="error_explain font_space" id="genderConfirm">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ErrorMessage="请选择性别"
                            ControlToValidate="gender" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                </div>
            </li>
            <li class="clear">
                <div class="name_list font_space fleft">
                    <span class="atten">*</span> 出生日期：</div>
                <div class="input_list font_space fleft">
                    <asp:TextBox ID="TB_birthday" runat="server" onblur="this.style.borderColor='#A3BFA8';"
                        onfocus="this.style.borderColor='#99E300';"></asp:TextBox>
                    <asp:ImageButton ID="ImgBntCalc" runat="server" ImageUrl="~/images/Calendar_scheduleHS.png"
                        CausesValidation="False" Style="border-width: 0px;" ImageAlign="AbsBottom" />
                    <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TB_birthday"
                        MaskType="Date" Mask="9999/99/99" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus"
                        OnInvalidCssClass="MaskedEditError" DisplayMoney="Left" AcceptNegative="Left"
                        ErrorTooltipEnabled="True">
                    </ajaxToolkit:MaskedEditExtender>
                    <ajaxToolkit:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender1"
                        ControlToValidate="TB_birthday" EmptyValueMessage="Date is required" InvalidValueMessage="Date is invalid"
                        Display="Dynamic" TooltipMessage="" EmptyValueBlurredText="*" InvalidValueBlurredMessage="*"
                      />
                    <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="TB_birthday"
                        PopupButtonID="ImgBntCalc" Format="d" />
                    <div class="error_explain font_space">
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="请正确输入出生日期"
                            ControlToValidate="TB_birthday" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                </div>
            </li>
            <li class="clear">
                <div class="name_list font_space fleft">
                    邮箱：</div>
                <div class="input_list font_space fleft">
                    <input runat="server" id="TB_email" type="text" size="36" onblur="this.style.borderColor='#A3BFA8';"
                        onfocus="this.style.borderColor='#99E300';" /><div class="error_explain font_space"
                            id="altConfirm">
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                runat="server" ErrorMessage="邮箱格式错误" ControlToValidate="TB_email" Display="Dynamic"></asp:RegularExpressionValidator>
                        </div>
                </div>
                <div class="explain_list fleft">
                    <span class="explain">万一你忘记密码，可通过此邮箱联系取回。</span></div>
            </li>
            <li class="clear">
                <div class="compart">
                </div>
            </li>
            <li class="clear">
                <div class="name_list font_space fleft">
                </div>
                <div class="input_list font_space fleft">
                    <asp:Button ID="Btn_save" runat="server" Text="确定" />&nbsp;&nbsp;
                    <asp:Label ID="L_msg" runat="server" Visible="False" Font-Bold="True" ForeColor="Red"></asp:Label>
                    <p>&nbsp;&nbsp;</p>
                </div>
                
            </li>
        </ul>

</asp:Content>
