Author: jack2006 | Posted on: 8/7/2009 12:50:48 AM | Views : 488

 the code from test.ascx.cs:
public partial class test : System.Web.UI.UserControl
{
    public static int a;
    protected void Page_Load(object sender, EventArgs e)
    {
        a=0;
    }
}
code from test.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<%@ Register src="test.ascx" tagname="test" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
 & ...

Go to the complete details ...