Ver Mensaje Individual
  #7 (permalink)  
Antiguo 03/05/2011, 16:50
jeimararias
 
Fecha de Ingreso: mayo-2011
Mensajes: 1
Antigüedad: 12 años, 11 meses
Puntos: 0
Respuesta: Variables globales en ASP.Net

Si son variables globales a una pagina, puede definirlascomo el siguiente ejemplo:

static class GlobalClass
{
private static string _savePath = "";
public static string SavePath
{
get { return _savePath; }
set { _savePath = value; }
}

private static bool _fileSaved = false;
public static bool FileSaved
{
get { return _fileSaved; }
set { _fileSaved = value; }
}
}

Posteriormente se pueden usar en el formulario como se muestra en los siguientes ejemplos:

GlobalClass.FileSaved = true;
GlobalClass.SavePath = MapPath("~/Archivos/Entrada/" + Path.GetFileName(e.filename));