码迷,mamicode.com
首页 > 其他好文 > 详细

解决百度编辑器带来的困扰(一)

时间:2014-08-31 10:27:21      阅读:249      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   os   使用   io   ar   for   

一、百度编辑器上传组件也是flash,故存在一些问题,就是在某些浏览器上传会丢失sessionid。
解决方法:
不好意思,因为我这边使用asp.net mvc,故解决代码是asp.net的。
在Global.asax文件加入如下代码:
bubuko.com,布布扣
/// <summary>
/// 手动完成页面的Cookie里的sessionid传送到后台 目前就配合uploadify 由于它flash丢失sessionid
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Application_BeginRequest(object sender, EventArgs e)
{
    //flash 上传组件Session 值恢复
    //‘scriptData‘: { ‘ASPSESSID‘: ‘@Session.SessionID‘ }
    try
    {
        string session_param_name = "ASPSESSID";
        string session_cookie_name = "ASP.NET_SessionId";

        if (HttpContext.Current.Request.Form[session_param_name] != null)
        {
            UpdateCookie(session_cookie_name, HttpContext.Current.Request.Form[session_param_name]);
        }
        else if (HttpContext.Current.Request.QueryString[session_param_name] != null)
        {
            UpdateCookie(session_cookie_name, HttpContext.Current.Request.QueryString[session_param_name]);
        }
    }
    catch (Exception ex)
    {
        ;
    }
}

void UpdateCookie(string cookie_name, string cookie_value)
{
    HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(cookie_name);
    if (cookie == null)
    {
        cookie = new HttpCookie(cookie_name);
        HttpContext.Current.Request.Cookies.Add(cookie);
    }
    cookie.Value = cookie_value;
    HttpContext.Current.Request.Cookies.Set(cookie);
}
View Code
很容易理解吧。
 
二、百度编辑器表格发布以后表格线会不见
解决办法在显示内容的页面加入如下样式:
bubuko.com,布布扣
.selectTdClass {
        background-color: #edf5fa !important;
 }
 
 table.noBorderTable td, table.noBorderTable th, table.noBorderTable caption {
     border: 1px dashed #ddd !important;
 }
 
 table {
     margin-bottom: 10px;
     border-collapse: collapse;
     display: table;
 }
 
 td, th {
     padding: 5px 10px;
     border: 1px solid #DDD;
 }
 
 caption {
     border: 1px dashed #DDD;
     border-bottom: 0;
     padding: 3px;
     text-align: center;
 }
 
 th {
     border-top: 1px solid #BBB;
     background-color: #F7F7F7;
 }
 
 table tr.firstRow th {
     border-top-width: 2px;
 }
 
 .ue-table-interlace-color-single {
     background-color: #fcfcfc;
 }
 
 .ue-table-interlace-color-double {
     background-color: #f7faff;
 }
 
 td p {
     margin: 0;
     padding: 0;
 }
View Code
试试吧,亲测 可以解决一般问题了。

解决百度编辑器带来的困扰(一)

标签:style   blog   http   color   os   使用   io   ar   for   

原文地址:http://www.cnblogs.com/helihui123/p/3947367.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!