2.- Agregar a la pagina aspx un scriptmanager.
3.- Crear un archivo js
- Click derecho sobre el proyecto
- Add
- New Item
- Seleccionar JScript File
- Colocar el Nombre
- Guardar
Type.registerNamespace("WebNext");
/*Constructor de la clase*/
WebNext.House = function(streetName, townName, zipCode) {
this._streetName = streetName;
this._townName = townName;
this._zipCode = zipCode;
}
/*Funciones (Propiedades, Metodos) de la clase*/
WebNext.House.prototype = {
getStreetName: function() {
return this._streetName;
},
getTownName: function() {
return this._townName;
},
getAddress: function() {
return this._streetName + '' + this._townName + ' ' + this._zipCode;
},
dispose: function() {
alert('removed ' + this.getAddress());
}
}
5.- Recordar que las instrucciones Type.registerNamespace("WebNext"); se encuentran dentro de la librerias de ASP net Ajax. Al final es necesario agregar la referencia del script al ScriptManager.
Saludos y espero que a mas de uno le sea de utilidad esta información.
ASPX COMPLETO
No hay comentarios:
Publicar un comentario