<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="importuri.aspx.cs" Inherits="TotCms.Web.Admin.label.importuri" ValidateRequest="false" %>

<!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 id="Head1" runat="server">
  <title>嵌入本地文件或URL</title>
  <link href="css.css" rel="stylesheet" type="text/css" />
  <script src="../js/common.js" type="text/javascript"></script>
  <script type="text/javascript"> 
    function retValue(){
	    var ret='';
	    var FileType=document.getElementById('FileType').value;	
	    var Encode=document.getElementById('Encode').value;
	    var FilePath=document.getElementById('FilePath').value;	
	    ret='ImportUri(';
	    ret+=FileType+',';
	    ret+=Encode+',';
	    ret+=FilePath+')';	
	    window.opener.document.form1.Content.value=ret;
	    window.close();
    }
    function Preview(){
      var ret='';
	    var FileType=document.getElementById('FileType').value;	
	    var Encode=document.getElementById('Encode').value;
	    var FilePath=document.getElementById('FilePath').value;	
	    ret='ImportUri,';
	    ret+=FileType+',';
	    ret+=Encode+',';
	    ret+=FilePath;	
		  document.getElementById('preframe').src='label_privew.aspx?content='+escape(ret);
    }
    function checkInt(obj){
	    var reg = /^(\d{1,4})$/; 
	    if(obj!="" && obj.match(reg)==null){
		    return 0;
	    }else{
	      return obj;
	    }
    }
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <fieldset style="text-align:center; ">
<legend>嵌入本地文件或URL</legend>
<table width="400" border="0" align="center" cellpadding="1" cellspacing="5">
  <tr>
    <td><div align="left">文件类型:</div></td>
    <td><div align="left">   
      <asp:DropDownList ID="FileType" runat="server">
        <asp:ListItem Value="0">本地文件</asp:ListItem>
        <asp:ListItem Value="1">网上文件</asp:ListItem>
      </asp:DropDownList>
</div></td>
  </tr>
  <tr>
    <td><div align="left">文件编码:</div></td>
    <td>
        <div align="left">
          <asp:TextBox ID="Encode" runat="server">utf-8</asp:TextBox>
      </div></td>
  </tr>
  <tr>
    <td><div align="left">文件路径:</div></td>
    <td><div align="left">
      <asp:TextBox ID="FilePath" runat="server"> </asp:TextBox>
      <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
        ControlToValidate="FilePath" ErrorMessage="文件路径不能为空"></asp:RequiredFieldValidator>
    </div></td>
  </tr>
  <tr>
    <td colspan="2">
      <div align="center">
        <input id="Ok" type="submit" value="确定" onclick="retValue()" />
        &nbsp;
        <input type="button"  onclick="window.close();" value="取消" />
    &nbsp;<input id="Button1" type="button" value="预览" onclick="Preview()" /></div></td>
  </tr>
</table>
 
</fieldset>
<fieldset>
  <legend>预览</legend>
  <iframe width="99%" frameborder="0" id="preframe" name="preframe" src="preview.htm"></iframe>
</fieldset>
    </form>
</body>
</html>
