大菠萝

大菠萝(Diablo)乃暗黑之王

.net 使用javascript的总结

  • 使用Attribute.Add,常用的有onClick,onKeyUp,onKeyDown等。如:
    Button.Attributes.Add("onClick", "test()")
    其中button为需要绑定javascript的控件ID,test()为绑定的Javascript函数。其中test()为
    <script>
    function test()
    {
    alert("hi");
    }
    </script>
  • 使用ClientScript.RegisterStartupScript直接执行javascript。
    ClientScript.RegisterClientScriptBlock(this.GetType(), "hi","<script>alert('hi')</script>")

Tags:|

by benben 5/1/2008 5:15:00 PM 固定连接 | Comments(0)| 程序设计

相关文章


留言





如果留言不成功请联系ben#119797.com