0
如何繼承類,當我嘗試繼承它時會給我一個錯誤。C#ASP.NET繼承
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class expresion2 : System.Web.UI.Page
{
public String nombre, email, telefono, contra, usuario;
protected void Page_Load(object sender, EventArgs e)
{
nombre = txtNombre.Text;
email = txtEmail.Text;
telefono = txtTel.Text;
contra = txtContra.Text;
usuario = txtUser.Text;
}
}
當我嘗試繼承 「expresion2」 它給了我2016
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class mostrar2 : expresion2
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
它不起作用!仍然給出相同的錯誤,是否有另一種方法來從expresion2繼承變量到mostra2? – Takami