问题如下:
当一个用户登陆成功后,看到首页为左右两个框架组成的页面,通过用户设置可以将首页风格改为上下两部分的页面,或者一个整页面的风格!小弟没有思路,不知道如何才能实现“让用户自定义首页风格”的功能,各位大侠帮忙,分少我再追加!最好能说的详细些!是在不行也请各位大侠能提供思路!!

解决方案 »

  1.   

    直接用javascript可以实现,,记得以前搞ASP的时候搞过.用javascript去掉框架
      

  2.   

    简单一点的,定义好几种风格让他选择,css和html先存数据库
    比如2个html两个css,风格1对应为html1和css1,2对应该2
    那么此用户后面加两个字段,存上他所选择的cssN和htmlN,当他在访问他的页面时,先从数据库里读出他这两个字段转到此html文件
      

  3.   

    将左右该成上下操作对应框架的样式即可. 改成一个整页那隐去一个好了...
    楼主找找用JAVASCRIPT 操作 DOM 的资料看看.
      

  4.   

    最好的办法就是换CSS.如2楼所说.
      

  5.   

    2楼的大哥,你的意思我明白了!但是小弟第一次做这个,两个技术问题还要问你:
    1是css+html的风格代码以怎样的形式存到数据库?
    2是怎样把这些风格代码加载到页面上?
      

  6.   

    用不着存数据库通过JAVASCRIPT既可换CSS
    然后用COOKIE保存相应的设置.
      

  7.   

    用户表
    ID 用户名  CSS文件 
    1 aaa         /css/style1.css
    2 bbb        /css/style2.css其中style1.css是左右结构,2是上下结构,3是整体===cs里
    public string cssFile;
    cssFile=这个字段的值aspx里
    <style type="text/css">
    @import url('<% =cssFile %>')
    </style>
      

  8.   

    写个简单的给你参考下:
    Default.aspx:
    <frameset id="mainFrame" name="main" framespacing="0" rows="62,*" cols="*" onload="self.resizeTo(screen.availWidth,screen.availHeight);self.moveTo(0,0)">
    <frame name="toolframe" marginWidth="0" marginHeight="0" src="Header.aspx" frameBorder="no" height="62px" noResize scrolling="no" />
    <!--frame id="topFrame" name="topFrame" marginWidth="0" marginHeight="0" src="" frameBorder="no" height="100px" noResize scrolling="no" /-->
        <frameset id="subFrameSet" border="2" name="framemenu" cols="272,*">
        <frame id="leftFrame" name="menu" src="http://doll-net.cnblogs.com" scrolling="no" border="2" />
        <frame id="rightFrame" name="mainframe" scrolling="yes" src="http://www.cnblogs.com/doll-net/archive/2008/02/02/CTE_PIVOT.html" frameborder="1" style="padding:0px;margin:0px; border-right:1px solid #ff000;" />
        </frameset>
    </frameset>
    Header.aspx:
    <script type="text/javascript">
            function changeCss(val)
            {
                //top.document.getElementById("frameCss").href = val + ".css";//假使对应的CSS名是这样否则去判断   
                //alert(top.document.getElementById("frameCss").href);
                var topSubFrameSet = top.document.getElementById("subFrameSet");
                switch(val)
                {
                    case "1":
                            topSubFrameSet.cols="";
                            topSubFrameSet.rows="200,*";
                        break;
                    case "2":
                            topSubFrameSet.cols="272,*";
                            topSubFrameSet.rows="";
                        break;
                    case "3":
                            topSubFrameSet.cols="0,*";
                            topSubFrameSet.rows="";
                        break;
                }   
                //写COOKIE:document.cookie="value";      
                //获取COOKIE:var cookieString = document.cookie;
            }
        </script>
    <select onchange="changeCss(this.value);">
                    <option value="1">上下</option>
                    <option value="2">左右</option>
                    <option value="3">一个</option>
                </select>