System Information

Impossible Is Nothing...

导航

日记本

在后台定位焦点
RegisterStartupScript("focus", " ");

A()
{
docuemnt.get..id().focus()
}



<%#DataBinder.Eval(Container.DataItem, "dateandtime")%>

现在读取出来的数据是2005-6-22 14:03:14中

如何只保留日期?
是DateTime类型的吗?
<%#((DateTime)DataBinder.Eval(Container.DataItem, "dateandtime")).ToShortDateString()%>
<%# System.DateTime.Parse(DataBinder.Eval(Container.DataItem, "dateandtime").ToString()).ToString("yyyy-MM-dd")%>


asp.net中如何截取前面20个字?(DataBinder.Eval(Container.DataItem, "title"))
<%# DataBinder.Eval(Container.DataItem, "title").ToString().Substring(0,20)%>
不过你如果你的字符长度不够20会出错的。
你可以在.cs中写啊,判断一下长度再Substring就行了。
<%# Left(DataBinder.Eval(Container.DataItem, "title"),20)%>
竖排文字

string str = "向雷锋同志学习";
                     string s="";
                     for(int i=0;i<str.Length;i++)
                     {
                            s+=str[i]+"\r\n";
                     }
                     MessageBox.Show(s);


一个问题是&BigClass=<%#Server.UrlEnCode(DataBind.Eval(Container.DataItem,"大类别")%>">链接字段
 
直接加在里面报错为CS0103: System.Web.HttpServerUtility”并不包含对“UrlEnCode”的定义
请问在那错了

二个问题是string a;a=Request.QueryString["InformId"].ToString();如果a 里面有单引号我怎么判断它里面是否有单引号?if(a怎么写?){}
else{}
三个问题是还有个问题是:Session["a"].默认情况是string行吗?那为什么用的时候还要这样写呢?
Session["a"].ToString;Session["a"]到底是什么东西?是对象还是简单类型,复杂类型?
Server.UrlEnCode -> Server.UrlEncode
if(a.LastIndexOf("'") != -1){}
Session["a"]是object类型

UrlEncode


如何在DataGrid的PagerStyle行(显示页数的行)上显示查询出来的记录数?
-------
你可以这样:
this.dataGrid1.Controls[0].Controls[this.dataGrid1.Controls.Count-1].Cells[0].Text = 你的记录数;


checkBoxList中,有一项被选中,如何把这一项设置为不可用
循环它,发现被选中,则加样式
this.List1.Items[n].Attributes.Add("disabled","true");
检查你的绑定事件,是否有放在
if(!this.IsPostBack)
{}
中,如果没有,那么每次均会重新加载,绑定的项目不起作用


C#如何在网页中实现对图片的放大缩小 和最简单的编辑

http://sz.luohuedu.net/xml/Images/logo.gif">>



ImageButton鼠标效果:
你可以添加个imagebutton控件如下

然后在page_load事件里写注册JS代码

ImageButton1.Attributes.Add("onmousemove", "javascript:document.all.ImageButton1.src='images/plmm1.jpg';")
        ImageButton1.Attributes.Add("onmouseout", "javascript:document.all.ImageButton1.src='images/plmm.gif';")

这样就可以了!

新窗口打开显示.
\');return false'>

posted on 2005-06-20 13:14  SysInfo  阅读(623)  评论(1编辑  收藏  举报