Chinaunix首页 | 论坛 | 博客
  • 博客访问: 491792
  • 博文数量: 130
  • 博客积分: 3581
  • 博客等级: 中校
  • 技术积分: 1200
  • 用 户 组: 普通用户
  • 注册时间: 2005-02-18 10:51
文章分类

全部博文(130)

文章存档

2016年(1)

2015年(8)

2014年(6)

2013年(2)

2012年(9)

2011年(16)

2010年(5)

2009年(4)

2008年(2)

2007年(6)

2006年(50)

2005年(21)

我的朋友

分类:

2006-05-14 07:40:19

1,在DataGrid中顯示圖片
                
       

2,發送郵件
<%@ Import Namespace="System.Web.Mail" %>
 public void Mail_Send(object sender, EventArgs e)
    {
   
        MailMessage MyMsg = new MailMessage();
        MyMsg.From = "
";
        MyMsg.To = "
";
        MyMsg.Subject = "test";
        MyMsg.Body = "test ";
        MyMsg.BodyFormat = MailFormat.Html;
        try
        {
            SmtpMail.Send(MyMsg);
            Response.Write("發送成功");
           
        }
        catch
        {
            Response.Write("發送失敗");
        }
    }

3,在DataGrid里的自動排序
 protected void dgFunc_ItemDataBound(object sender, DataGridItemEventArgs e)
    {
        string strID = Convert.ToString(e.Item.ItemIndex + 1);
        if (strID == "0")
        {
        }
        else
        {
            e.Item.Cells[0].Text = strID;
        }
    }

3,DropDownList綁定兩個字段
select a + b as c from table
DropDownList.DataTextField = "c";

4,DropDownList綁定
 ListItem li;
        li = ddlDeptEnt.Items.FindByValue("1005");
        if (li != null)
            li.Selected = true;

5,CheckBoxList綁定
for(int j=0;j{
      if(temp.IndexOf(Checkboxlist1.Items[j].Value)!=-1)
    Checkboxlist1.Items[j].Selected=true;
}

6,這個方法沒用過不知道干什么的
if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ListItem li = CheckBoxList1.Items.FindByValue(dt.Rows[i]["blogmenuid"].ToString());
                if (li != null)
                  li.Selected = true;
              }
      }
阅读(681) | 评论(0) | 转发(0) |
0

上一篇:文件上傳

下一篇:几個js

给主人留下些什么吧!~~