[ComVisible(true)] public class MyHandler { [DispId(0)] public bool Handler() { //your event handler code here. } }MyHandler h = new MyHandler();//use h as the 2nd param.
我试了一下,没有效果呀.还有,按照你的方法,怎样在C#中写一些jscript语句呀? public bool Handler() { //也就是在这里我应该怎样添加控制网页元素的语句.例如我想加一个alert('')之类的 }
public class MyHandler {
[DispId(0)]
public bool Handler() {
//your event handler code here.
}
}MyHandler h = new MyHandler();//use h as the 2nd param.
public bool Handler() {
//也就是在这里我应该怎样添加控制网页元素的语句.例如我想加一个alert('')之类的
}
string str="<script language=javascript>alert("+"mystr"+");</script>";
this.Page.RegisterStartupScript("clientscript",str) ;