示例#1
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.siteTemplate  = SiteTemplate.GetCacheSiteTemplateByID(base.OpID);
     this.strFolderPath = WebUtils.GetQueryString("folder");
     this.strFileName   = WebUtils.GetQueryString("file");
     this.strFolderPath = this.GetTempletPath(this.strFolderPath);
     if (!System.IO.Directory.Exists(this.strFolderPath))
     {
         MessageUtils.ShowAndRedirect(this, "模板文件不存在", "TemplateList.aspx?Module=" + base.CurrentModuleCode + "&action=View");
     }
     else
     {
         this.txtFolderPath.Text = this.strFolderPath;
         string templateFilePath = this.GetTemplateFilePath();
         if (!base.IsPostBack && base.Action == ActionType.Modify.ToString())
         {
             if (base.Action == ActionType.Modify.ToString() && !System.IO.File.Exists(templateFilePath))
             {
                 base.ShowMsgAndRdirect("模板文件不存在", "TemplateList.aspx?Module=" + base.CurrentModuleCode + "&action=View");
             }
             else
             {
                 this.FileContent.Text    = FileUtils.ReadFileContent(templateFilePath);
                 this.txtFileName.Text    = this.strFileName.Substring(0, this.strFileName.LastIndexOf("."));
                 this.txtFileName.Enabled = false;
                 ListItem listItem = this.ddlFileType.Items.FindByText(System.IO.Path.GetExtension(this.strFileName));
                 if (listItem != null)
                 {
                     listItem.Selected = true;
                 }
                 this.ddlFileType.Enabled = false;
             }
         }
     }
 }
示例#2
0
 protected void Page_Load(object sender, System.EventArgs e)
 {
     this.siteTemplate = SiteTemplate.GetCacheSiteTemplateByID(base.OpID);
     if (this.siteTemplate == null)
     {
         MessageUtils.ShowAndRedirect(this, "没有找到模板信息", "TemplateList.aspx?Module=" + base.CurrentModuleCode + "&action=View");
     }
     else
     {
         this.BindData();
     }
 }