探討一下.net里面的服務器端和客戶端互相調用時注意和存在的問題,有興趣可以進來參加討論,散分 http://xml.sz.luohuedu.net/xml/ShowDetail.asp?id=HLFQ4ZOY-N3GO-4R7Y-WY5R-XZZN2JY5J8HZ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不知道你问的是不是:在html页先写好<javascript>函数,在后台.cs中想调用该函数?? 是啊,或者是在html中寫好的<vbscript>的調用過程,我要在.cs文件中調用它,各位有沒有寫好的代碼啊. 不能直接调用只能说是服务端生成调用javascript的代码, 网页下载到客户端IE后再执行 可以。ASP.Net中Page和控件都可以注册客户端代码。详细可看.Net Framework的Help 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 读别人代码有一个DataSetBook类,和DataSet数据集有关系,有很多代码,请问怎么产生的呢? winform远程获取服务器端ip 如何在C#应用程序中调用SQL Server 2005创建的存储过程 WCF客户端取数很慢的问题怎样解决? 登陆时间。退出时间代码 用DirectoryEntry新建AD用户,怎样可以让“密码永不过期”? 怎么把1 转成字符串A? propertygrid控件的处理 C#中语句的意义? 如何实现动态载入模块? 怎么在项目中,导入自定义的windows control library? 各位老大,请教关于单击与双击windows窗体datagrid问题
在html页先写好<javascript>函数,在后台.cs中想调用该函数??
各位有沒有寫好的代碼啊.
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