随笔-7  评论-24  文章-102  trackbacks-0
总感觉这两个项目练习做起来很没有动力? 是因为项目本身大量重复利用 GridView 展示数据使我感觉到厌烦没有挑战性,还是我能力不够不能想到更有效率的数据应用???总之,能多练习还是不错的,希望下次能在枯燥的任务下多尝试下有趣的新东西.....


 遇到问题与解决存档

1、出错一次之后 linq 不自动释放, 然后老是提示插入已经存在的实体



2、2个层相连接 中间的细线问题

<div><img alt="登陆" height="26" src="images/login.gif" /></div>

div 高度根据内容自适应问题

height:100%


css中如何使div居中(垂直水平居中)
http://www.7say.com/article.asp?id=184


3、FileUpload 与 提交面板冲突
commandName 与 回传页判断冲突  (需在回传的时候在一次绑定 Gv数据源,comman事件才起作用)



4、用 Response.Write("") 传输脚本<script>文件 会影响CSS架构
            ScriptManager.RegisterStartupScript(this.butInsert, this.GetType(), "ok",
                "alert('增加成功');", true);


5、自动刷新页面

   <script language=javascript>window.location.href=document.URL;
    </script>" );

 Response.AddHeader( "Refresh","0" );
Response.Redirect( Request.Url.ToString( ) );


6、My97DatePicker 日历插件
<script language="javascript" type="text/javascript" src="../My97DatePicker/WdatePicker.js"></script>

 onFocus="new WdatePicker(this,'%Y-%M-%D %h:%m:%s',true,'default')"



7、LINQ 修改一个实体的外键 需用到的表达式(奇怪的 ORM思想表现方式)
Lambda 用在基于方法的 LINQ 查询中,作为诸如 Where 和 Where 等标准查询运算符方法的参数。
old.xxx = db.RoleInfo.Single(p => p.RoleId == (int)RoleInfoType.超级管理员);

linq to sql 怎么修改有外键约束的列
http://forums.microsoft.com/china/ShowPost.aspx?PostID=4084266&SiteID=15

新Orcas语言特性:Lambda表达式
http://blog.joycode.com/scottgu/archive/2007/04/09/100744.aspx

Lambda 表达式(C# 编程指南)
http://msdn.microsoft.com/zh-cn/library/bb397687.aspx



8、Asp.Net 的用户凭证
string strRedirect = Request.QueryString["ReturnUrl"];
System.Web.Security.FormsAuthentication.SetAuthCookie(instance.RoleInfo.RoleName, true);
if (strRedirect != null)
   Response.Redirect(strRedirect);


        System.Web.Security.FormsAuthentication.SignOut();
        Response.Redirect("~/Default.aspx");


    <authentication mode="Forms">
      <forms loginUrl="~/Default.aspx" timeout="60"></forms>     
    </authentication>


<system.web>
      <authorization>
            <allow users="超级管理员,VIP会员,普通会员"/>
        <deny users="*"/>
      </authorization>
    </system.web>

ASP .NET 中的身份验证:.NET 安全性指导
http://www.iwms.net/n809c12.aspx




9、关于枚举 Enum
    定义枚举时候直接使用中文,然后可以利用枚举静态方法读取枚举中文名    Enum.GetName(typeof(XXXXType), (int)objVaule)  ?? 
    如果要考虑到多语言话的问题  建议使用数据库存储



10.合并单元格

TableCell[] tempCells = new TableCell[gv.Rows[0].Cells.Count - 1];


        //遍历行
        for (int r = 0; r < gv.Rows.Count; r++)
        {
            //行内遍历单元格
            for (int i = 0; i < tempCells.Length; i++)
            {
                if (tempCells[i] != null && gv.Rows[r].Cells[i].Text.Equals(tempCells[i].Text))
                {
                    tempCells[i].RowSpan++;
                    gv.Rows[r].Cells[i].Visible = false;
                }
                else
                {
                    tempCells[i] = gv.Rows[r].Cells[i];
                    tempCells[i].RowSpan = 1;
                }
            }
        }


11、Linq 的分页讨论
http://www.cnblogs.com/9527/archive/2007/07/05/807451.html

DLINQ(LINQ to SQL)之大数据量分页、延迟执行和日志记录
http://www.mikecat.net/showtopic-36.aspx

VS2008的Linq,更新数据就那么费劲?
http://dev.yesky.com/msdn/319/3499319.shtml

LINQ体验(9)——LINQ to SQL语句之Insert/Update/Delete操作
http://www.cnblogs.com/lyj/archive/2008/01/28/1056133.html




12、JS 模式窗口
举例讲解returnValue的含义
http://dev.csdn.net/develop/article/47/47565.shtm

利用AJAX实现 web页面的模式对话框
http://www.javaeye.com/topic/39062

示例:签名栏图片展示特效
http://bbs.duowan.com/viewthread.php?tid=12573003###




13、XML文件的写入权限   需手动指定权限
sys.WebForms.PageRequestManagerServerErrorException:错误原因



posted on 2009-01-12 15:35 黄小二 阅读(367) 评论(0)  编辑  收藏 所属分类: ASP.NET

只有注册用户登录后才能发表评论。


网站导航: