新过来的,再100分求解~如何调用在ASP。NET中写的类?
我新建立了一个C#类命名为:RegistrationInformation。代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
/// Class1 的摘要说明
/// </summary>
public class Class1
{
public Class1()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public struct RegistrationInformation
{
private string name;
public string Name
{
get { return Name; }
set { Name = value; }
}
private string sex;
public string Sex
{
get { return Sex; }
set { Sex = value; }
}
private string nation;
public string Nation
{
get { return Nation; }
set { Nation = value; }
}
}
}
//==================================================================
书里面说的比较模糊,我弄了半天还没弄出来~
在第一页代码里~Default.aspx.cs 写的代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{