书没见过 多靠平时积累   
最简单的用 Response.write();基本上都可以把javascript写到页面执行

解决方案 »

  1.   

    帮你顶到前面去:
      
        C#做WEB开发时能不能不使用javascript?最好是不用它!
      

  2.   

    js很强大啊。很多功能不用刷新界面就可以实现。但是c#postback太频繁就不好了
      

  3.   

    private void projectinfo_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
    {
    if(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
    {
    if(sCommadType.ToLower() == "add")     //定制添加项目信息的datagride的样式
    {
    //邦定连接字段
    string NavigaterUrl = PargetUrl+"?id="+e.Item.Cells[3].Text+"&zyid="+e.Item.Cells[11].Text+"&MainProID="+e.Item.Cells[9].Text+
                                 "&MainProjectName="+Server.UrlEncode(e.Item.Cells[8].Text)+"&MainBulidUnit"+Server.UrlEncode(e.Item.Cells[1].Text);
    //定制客户端属性
    e.Item.ToolTip = "时间:"+e.Item.Cells[5].Text+"名称:"+e.Item.Cells[6].Text+"内容:"+e.Item.Cells[9].Text;
    e.Item.Attributes.Add("onmouseover","this.bgColor='#ffefe5'");
    e.Item.Attributes.Add("onmouseout","this.bgColor='#ffffff'");
    e.Item.Cells[0].Attributes.Add("onclick","javascript:show1()");
    e.Item.Attributes.Add("onclick","javascript:window.open('"+NavigaterUrl+"','MainFrameSetMain'),this.bgColor='#C1D2EE'");
    //不换行显示
    e.Item.Cells[0].Text =  "<nobr>&nbsp<a href='"+NavigaterUrl+"' target='MainFrameSetMain'><img src='../images/folder.small.png' border=0 height='16px'></img>"+e.Item.Cells[0].Text + "</a></nobr>"; 
    for(int i=1;i<e.Item.Cells.Count;i++)
    {
    e.Item.Cells[i].Text = "<nobr>&nbsp"+e.Item.Cells[i].Text+"</nobr>";
    }
    //添加美感图象

    }
    }
    }
      

  4.   

    Respoint.Write()把你的javascript代码写到页面上就可以了,这方面的书好像不多,我也是从CSDN查到这样用的,msdn上也有相关的介绍