posts - 17,  comments - 11,  trackbacks - 0
 

需要对数值进行格式化,我们使用格式字符串指定格式将数值以一定的格式来呈现。格式字符串采用以下形式:Axx,其中 A 为格式说明符,指定格式化类型,xx 为精度说明符,控制格式化输出的有效位数或小数位数。

格式说明符   说明       示例                         输出
C                 货币       2.5.ToString("C")               ¥2.50
D                 十进制数   25.ToString("D5")               00025
E                 科学型     25000.ToString("E")           2.500000E+005
F                 固定点     25.ToString("F2")               25.00
G                 常规       2.5.ToString("G")                 2.5
N                 数字       2500000.ToString("N")       2,500,000.00
X                 十六进制   255.ToString("X")                 FF


posted @ 2011-01-11 18:41 天歆 阅读(32) 评论(0) 编辑
摘要: open() 方法用于打开一个新的浏览器窗口或查找一个已命名的窗口。 语法:window.open(URL,name,features,replace) 阅读全文
posted @ 2008-12-24 09:33 天歆 阅读(746) 评论(0) 编辑
  1. 页面:

     <body onload="frmOnload()" onResize="frmOnload()">
        ……
        <div id="div1" onscroll="scrollDiv();" style="width:100%;height:100px;overflow:auto;">
        ……
        </div>
        <input type="hidden" id="pos" />
        ……
    </body>

  2. javascript脚本:

     <script language="javascript" type="text/javascript"> 
          function  frmOnload()    
          {
                if( typeof(document.getElementById("div1") )!='undefined')  
                {
                    var spos = document.getElementById("pos").value; 
                    document.getElementById("div1").style.height=document.body.clientHeight-40;
                    if(! spos)spos=0; 
                        document.getElementById("div1").scrollTop=spos;

                }
            }
            function scrollDiv()
            {
                document.getElementById("pos").value=document.getElementById("div1").scrollTop;                         
             }  

    </script>

posted @ 2008-05-09 09:16 天歆 阅读(2371) 评论(0) 编辑
摘要: C#解码Base64编码内容的方法阅读全文
posted @ 2008-03-18 14:42 天歆 阅读(162) 评论(0) 编辑
摘要: C# 解quoted-printable编码的方法
阅读全文
posted @ 2008-03-18 14:30 天歆 阅读(161) 评论(0) 编辑
摘要: protect void RepDataBind( )
{
//设置RepotViewer的处理类型为本地报表
ReportViewer1.ProcessingMode = ProcessingMoedel.Local;
……
}阅读全文
posted @ 2007-07-25 16:41 天歆 阅读(184) 评论(0) 编辑
摘要: 在行/数据项 绑定事件中,需要对对应的记录的其它数据在cs代码文件中 读取。需要获取对应的记录.
Gridview控件:
protected void GridView1_RowDataBound ( object sender , GridViewRowEventArgs e )
{
DataRowView drv = (DataRowView) e.Row.DataItem
}阅读全文
posted @ 2007-07-25 16:07 天歆 阅读(138) 评论(0) 编辑
摘要: 1、设置三个参数: IDLabel、IndexLabel、flagLabel
2、在GridView中的SelectedIndexChanged 事件中对IDLabel赋值
3、在GridView中的RowDataBound 事件中获取最近一次操作行目前所在的位置
4、在GridView的DataBound事件中指定选中行的索引
阅读全文
posted @ 2007-01-25 18:58 天歆 阅读(217) 评论(0) 编辑
摘要: 两条关于生成排名的SQL语句: select name,score,(select count(*) from t where score>a.score)+1 from t a order by score 上面是:1,2,3,3,3,6,7... 下面是:1,2,3,3,3,4,5 select name,score,(select count(distinct score) from ...阅读全文
posted @ 2006-11-09 13:58 天歆 阅读(72) 评论(0) 编辑
摘要: 当要修改从数据库中读取的数据时,通常要先将数据显示在页面上,需要设置DropDownList 或其他List绑定数据的选中状态。
如果没有静态添加数据项,即AppendDataBoundItems="False"时,选中代码如下:
....
如果一个List控件既有静态添加的数据,又有绑定数据的时候,并且AppendDataBoundItems="True"时,
直接写上面的代码,第一次是无效的。解决办法就是,清空所有选项,重新静态添加数据项并且利用数据源重新绑定数据再执行以上代码。阅读全文
posted @ 2006-10-18 10:59 天歆 阅读(1362) 评论(1) 编辑
昵称:天歆
园龄:5年5个月
粉丝:0
关注:0

<2012年2月>
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910

搜索

 
 

常用链接

最新随笔

我的标签

随笔档案

文章分类

Ajax

asp.net

友情博客

杂项

最新评论

阅读排行榜

评论排行榜

推荐排行榜