Estoy haciendo pruebas y veo que me falta más teoría...
conexion.cs
Código:
using System.Data;
using System.Data.Odbc;
public class Conexion {
string servidor;
string usuario;
string contrasena;
string baseDatos;
string driver;
public Conexion() {
// blablabla
}
}
index.cs:
Código:
// C# Document
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using Conexion;
public class Inicio:Page {
Label txtNombre = new Label();
public Inicio() {
txtNombre.Text = "sdf";
}
}
index.aspx:
Código HTML:
<%@ Page Language="C#" Inherits="Inicio" Src="index.cs" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Página de Prueba</title>
</head>
<body>
<form runat="server">
Texto -> <asp:Label id="txtNombre" runat="server"></asp:Label>
</form>
</body>
</html>
ERROR: The type or namespace name 'Conexion' could not be found (are you missing a using directive or an assembly reference?).
¿Por qué no me está reconociendo la referencia a la clase Conexion?, ¿cuál es la forma correcta de comunicar las clases entre sí?.