http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=HLFQ4ZOY-N3GO-4R7Y-WY5R-XZZN2JY5J8HZ

解决方案 »

  1.   

    不知道你问的是不是:
    在html页先写好<javascript>函数,在后台.cs中想调用该函数??
      

  2.   

    是啊,或者是在html中寫好的<vbscript>的調用過程,我要在.cs文件中調用它,
    各位有沒有寫好的代碼啊.
      

  3.   

    不能直接调用只能说是服务端生成调用javascript的代码, 网页下载到客户端IE后再执行
      

  4.   

    可以。ASP.Net中Page和控件都可以注册客户端代码。详细可看.Net Framework的Help
      

  5.   

    wo lai:
    if(!IsPostBack){
    StringBuilder str=new StringBuilder();
    str.Append("<script language=\"javascript\">\n");
    str.Append("<!--\n");
    str.Append("function TextPopup_dokeydown(textID,textName,file,width,height,splitString,mouse)\n");
    str.Append("{ if(event.keyCode==13 || mouse==1) { \n");
    str.Append("if(file!=null && file!='' && event.srcElement.tagName=='INPUT' && event.srcElement.value!='' || event.srcElement.tagName=='IMG')\n");
    str.Append("{\n");
    str.Append("if(mouse!=1) file=file+'?popID='+textID.value;\n");
    str.Append("var win=window.showModalDialog(file,'','dialogWidth:'+width+'px;scroll:no;dialogHeight:'+height+'px;status:0;help:0;edge:raised');\n");
    str.Append("//win='hello/*3000*/everyone';\n");
    str.Append("try{\n");
    str.Append("if(win!=null)\n");
    str.Append("{\n");
    str.Append("win=win.split(splitString);\n");
    str.Append("textID.value=win[0];\n");
    str.Append("textName.value=win[1];\n");
    str.Append("}}catch(e){}\n");
    str.Append("}\n");
    //str.Append("event.keyCode=9;\n");
    str.Append("textName.focus();\n");
    str.Append("} }\n");
    str.Append("//-->\n");
    str.Append("</script>\n"); if(!this.Page.IsStartupScriptRegistered("TextPopup_dokeydown"))
    this.Page.RegisterStartupScript("TextPopup_dokeydown",str.ToString());
    }
    顺便请教:http://expert.csdn.net/Expert/topic/2134/2134238.xml?temp=.5905115