易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net后台向前台注册js函数和数组

1. 注册js函数
String scriptString = "<script language=JavaScript>function doClick(){";
scriptString += "for(var index=0;index<myArray.length;index++)";
scriptString += "alert(myArray[index]);}<";
scriptString += "/" + "script>";
ClientScript.RegisterStartupScript(typeof(WebForm2), "arrayScript", scriptString);
2. 注册数组
ClientScript.RegisterArrayDeclaration("myArray", "\"x\",\"y\",\"z\"");


相关文档:

asp.net 获取网站根目录

获取网站根目录的方法有几种如:
Server.MapPath(Request.ServerVariables["PATH_INFO"])
 Server.MapPath("/")
 Server.MapPath("")
Server.MapPath(".")
 Server.MapPath("../")
 Server.MapPath("..")
  &nb ......

asp.net中用法总结——个人

1:在.aspx页面,<% %>标签相当于在.cs页面的代码,也就是说你在.cs文件里面怎样写,就可以在.aspx文件里面的<% %>标签里面怎样写。
2:在.aspx页面,<%= %>标签可以调用你的后台的变量或者方法等,不过被调用的方法必须是public的。
如果你的Default.cs文件里面有:
public string str = "调用后台方 ......

Asp.net AJAX Web Service写法差异

在C#中
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.Script.Services;
using System.Collections.Generic;
using System.Collections;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.Ba ......

asp.net C#网站项目 获取物理路径、虚拟路径的方法

-----------------------------.cs类文件中
当前项目的物理路径嘛:  
   
  strPath   =   this.Server.MapPath(Request.PhysicalApplicationPath);  
   
  你要说明什么“类文件”。任何PAGE、CONTROL代码也是在类 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号