日期:2014-05-16 浏览次数:20889 次
为了利于SEO优化,最近在项目中需要把某些页面转化为静态页面,现把相关思路整理如下。
/// <summary> /// Saves the data. /// </summary> /// <param name="id">The id.</param> private void SaveData(int id) { Model.C_Template model = GetData(id); if (model != null) { long x = 0; if (id <= 0) { x = model.id = _BLL.Add(model); } else { x = _BLL.Update(model) ? 1 : 0; } //other code //show message if (x > 0) { MessageBox.Show(string.Format(_jsonResult, "true", "保存成功", _returnUrl, id.ToString()), MessageEnum.Error); } else { MessageBox.Show(string.Format(_jsonResult, "false", "保存失败,请稍候再试...", "", id.ToString()), MessageEnum.Error); } } else { //有错误 MessageBox.Show(string.Format(_jsonResult, "false", _pageMsg, "", id.ToString()), MessageEnum.Error); } }
<!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>{$title} - {$classcName} - <!--#include file="/include/common/siteTitle.html" --></title> <meta name="description" content="{$seoDescription},<!--#include file="/include/common/siteDescription.html" -->" /> <meta name="keywords" content="{$seoKeyWords},<!--#include file="/include/common/siteKeyWords.html" -->" /> <link href="/css/layout.css" rel="stylesheet" type="text/css" /> <link href="/css/layout_sub.css" rel="stylesheet" type="text/css" /> <script src="/js/jquery/jquery.js" type="text/javascript"></script> <script src="/js/jquery/myJS.js" type="text/javascript"></script> <!--[if lte IE 6]> <script type="text/javascript" src="/js/ie6png.js"></script> <![endif]--> <script type="text/javascript"> $(function () { $(".hotSchool .tabs").tabs(".hotSchool div.contentC", { event: 'click', effect: 'fade' }); }); </script> </head> <body> <div id="bgImgWrap"> <img src="/images/back1.jpg" alt="" /> </div> <!--#include file="/include/common/picStory.html" --> <div c