| 发表于:2007-04-23 13:41:14 楼主 |
我通过dw的热点(map),看看点击的哪个热点,做相应的判断和数据库操作。听了些达人的指点,感觉ajax是比较好,所以尝试了以下。 我下载了ajaxpro.2.dll(由于是vs2005么) 在web.config中 <httphandlers> <add verb= "post,get " path= "ajaxpro/*.ashx " type= "ajaxpro.ajaxhandlerfactory, ajaxpro.2 "/> </httphandlers> 在cs文件中,注册 public partial class student_s405 : system.web.ui.page { protected void page_load(object sender, eventargs e) { ajaxpro.utility.registertypeforajax(typeof(student_s405)); //ajax注册 } } cs中的函数 [ajaxpro.ajaxmethod] public string map1_onclick() { this.title = "测试 ";//修改title,测试用 return this.title; } 在js里面,调用cs里面的函数 <script language= "javascript " type= "text/javascript "> function a() { var title= s405.map1_onclick(); alert(title); } </script> 在热点里面触发 <map name= "map "> <area shape= "rect " coords= "21,79,115,104 " onclick= "a() " href= "# "> </map> 。。。。。。。。。。。。。。。。。。。。。。。。。。。 以上是代码,运行的 时候,不知道为什么,出现个弹出框,里面显示 [object object] 不知道是什么原因,title并没有改变。。。 |
|
|
|
|