项目学习积累1
gridview显示问题
1、网格线
有2种方法去掉
第一种,在页面上写td的属性,边框为0px;然后设置GridView的自身边框为0PX,就可以了,但很少用这种了,以前用过段时间
第二种,
GridLines="None" BorderWidth="0" CellPadding="0" CellSpacing="1"
属性写在GridView标签中去,这个兼容火狐
2、时间只显示 年-月
<asp:BoundField DataField="F_IssueDate" DataFormatString="{0:yyyy-MM}" HtmlEncode="false" HeaderText="上传时间" />
3、girdview内容靠左显示
<RowStyle HorizontalAlign="Left" />
4、行背景色设置
前台GridView添加属性OnRowDataBound="GridView1_RowDataBound"
后台添加事件RowDataBound函数
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView row = e.Row.DataItem as DataRowView;
if (e.Row.RowIndex % 2 == 0)
{
//e.Row.Attributes.Add("style", "background-color:blue;");
}
else
{
e.Row.Attributes.Add("style", "background-color:AliceBlue;");
}
}
}
//上传文件并指定上传目录的路径,相对路径
FileUpload.PostedFile.SaveAs(Server.MapPath("~\\UploadFiles\\") + FileUpload.FileName);
多个关键字进行搜索,以空格作为分割的方法(.Net/C#)
2010-06-13 16:13
|
string StrA = this.TextBox1.Text;//关键字输入框,是否为空字符串大家要判断的。 |

浙公网安备 33010602011771号