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

asp.net在线人数统计

有人也问了个在线统计的问题,我的见意是这样的:  
  在Application_Start事件中加入以下代码:  
  Application.Lock();  
  Application.["UserCount"]=0;  
  Application.Unlock();  
   
  Session_Start事件中加入以下代码:  
  Application.Lock();  
  Application["UserCount']=Int32.Parse(Application["UserCount"].Tostring())+1;  
  Application.UnLock();  
   
  Session_End事件中加入以下代码:  
  Application.Lock();  
  Application["UserCount"]=Int32.Parse(Application["UserCount"].Tostring())-1;  
  Application.UnLock();  
   
   
  在要显示的地方写个函数加入以下代码:  
  Response.Write(Application["UserCount"].Tostring());  
   
  这就OK了


相关文档:

ASP.NET中javascript与c#互相访问

下面要解决的问题如下:
       1.如何在JavaScript访问C#函数?
  2.如何在JavaScript访问C#变量?
  3.如何在C#中访问JavaScript的已有变量?
  4.如何在C#中访问JavaScript函数?
  问题1答案如下:
  javaScript函数中执行C#代码中的函数:
  方法一:
  &nbs ......

ASP.NET 实现多版本語言

public class PageBase:System.Web.UI.Page
{
 public PageBase()
 {
  //
  // TODO: Add constructor logic here
  //
 }
    protected override void InitializeCulture()
    {
        // ......

ASP.NET 配置节架构

ASP.NET 配置节架构包含控制 ASP.NET Web 应用程序行为的元素。如果为属性指定了默认值,则该默认值是在 Machine.config 文件中设置的,该文件的路径是 systemroot\Microsoft.NET\Framework\versionNumber\CONFIG\Machine.config。
<configuration>
   <location>
      ......

ASP.NET MVC介绍

The Model-View-Controller (MVC) architectural pattern separates an application into three main components: the model, the view, and the controller. The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is ......

ASP.NET中常用的三十三种代码


 1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.为按钮添加对话框
Button1.Attribute ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号