Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Go Back   Foros Club Delphi > Otros entornos y lenguajes > .NET
Register FAQ Members List Calendar Guía de estilo Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 24/04/2007
mariosaurio mariosaurio is offline
Registrado
 
Join Date: May 2006
Posts: 3
Poder: 0
mariosaurio Va por buen camino
Utiles JavaScript para proyectos ASP.NET con ECO

Otro aporte.

http://www.terawiki.clubdelphi.com/a...JavaScript.zip

Aqui encontran funciones muy utililes a la hora de diseñar proyecto ASP.NET con ECO.

Solo hagan referencia al archivo JAVASCRIPT.PAS en cada pagina que realicen y listo.

Detallo las funciones que dispone.


// métodos que escriben pequeño comandos
class procedure WriteStartScript(Code: StringBuilder);static;
class procedure WriteStartFunction(Name: String; Code: StringBuilder; Parameters: string = '');static;
class procedure WriteEndScript(Code: StringBuilder);static;
class procedure WriteEndFunction(Code: StringBuilder);static;
class procedure WriteConfirm(Question: String; Code: StringBuilder);static;
class procedure WriteAlert(Information: String; Code: StringBuilder);static;
class procedure WriteRedirect(ToPage: String; Code: StringBuilder);static;

// métodos que escrebe funciones complejas
class procedure SetFocus( AOwner : System.Web.UI.Page; const AWebControls : WebControl; const ARegister : Boolean);static;
class procedure ShowMessage( AOwner : System.Web.UI.Page; const AMessage : String; const ARegister : Boolean);static;
class procedure ShowMessageAndRedirect( AOwner : System.Web.UI.Page; const Information, ToPage: String; const ARegister : Boolean);static;
class procedure ConfirmAndRedirect(AOwner: System.Web.UI.Page;Question, RedirectTo: String);static;
class procedure OpenWindow(AOwner: System.Web.UI.Page);static;
class procedure SetVisibility(AOwner: System.Web.UI.Page);static;
class procedure InvertVisibility(AOwner: System.Web.UI.Page);static;

// métodos de registro de script
class procedure RegisterStartupScript(AOwner : System.Web.UI.Page; Key: String; Code: StringBuilder);static;
class procedure RegisterClientScript(AOwner : System.Web.UI.Page; Key: String; Code: StringBuilder);static;

class function HTMLEncode( s : String ) : String;static;
class procedure ClickSaveConfirm( Sender : WebControl);static;
class procedure ClickDeleteConfirm( Sender : WebControl);static;
class procedure ClickConfirm( Sender : WebControl; const msg : String);static;
class procedure ClickOpenNewWindow( Sender : WebControl; const URL : String);static;
class procedure RegisterOnKeyDownButton(Sender: System.Web.UI.Control; Btn: System.Web.UI.WebControls.Button); static;
class procedure GoAnchor( AOwner : Page;
const anchor : String; const ARegister: Boolean);static;
class procedure AbrirVentana(AOwner: System.Web.UI.Page;const URL:String);static;
class procedure SetInitialFocus(c:Control);static;
class procedure SetInitialFocusSelect(c:Control);static;
Class Procedure SetAttributes(Page:control);static;
class procedure HabilitarEnterScript(page);static;
Class Procedure DesabilitarBotones(Page:control);static;
Class Procedure HabilitarBotones(Page:control);static;
Class Procedure HabilitarCajasTexto(Page:control);static;
Class Procedure DesabilitarCajasTexto(Page:control);static;



Por ejemplo yo aplico la funcion de de TAB por ENTER que es muy util a la hora de introducir informacion en un formulario. ejemplo.




procedure TWFEdicionControlMensual.Page_Load(sender: System.Object; e: System.EventArgs);
var
Id: string;
begin
EcoSpace.Active := True;
Id := Request.Params['RootId'];
if Assigned(Id) and (Id <> '') then
begin
rhRoot.SetElement(ObjectForId(Id));
if not IsPostBack then
begin
if (rhRoot.Element.AsObject as ControlMensual).Zona<>nil then
ddlZona.SelectedValue:=(rhRoot.Element.AsObject as ControlMensual).Zona.sNombre;

end;
end;
if not IsPostBack then
DataBind;
// TODO: Put user code to initialize the page here
if not IsPostBack then
begin
TJavaScript.HabilitarEnterScript(Page);
TJavaScript.ClickSaveConfirm(btnGrabar);
TJavaScript.ClickDeleteConfirm(btnEliminar);
TJavaScript.SetInitialFocus(txtFactorReposicion);
// TJavaScript.SetAttributes(Page);
end;
TJavaScript.SetAttributes(Page);

end;


Espero que les sirva de algo.

Mariosaurio
Reply With Quote
  #2  
Old 25/10/2007
pablito373 pablito373 is offline
Miembro
 
Join Date: Mar 2007
Posts: 10
Poder: 0
pablito373 Va por buen camino
No puedo descargar el archivo

Hola, no puedo descargar el archivo y la verdad me seria de utilidad el codigo javascript encapsulado asi....

Me lo puedes enviar???
Reply With Quote
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
programacion+proyectos mahlon OOP 17 22/11/2006 16:46
Manejo proyectos Ricardo Alfredo Varios 4 04/02/2006 01:15
Procedimientos Utiles !!! Xianto MS SQL Server 2 17/08/2005 10:28
Consejos útiles yusnerqui Humor 0 12/07/2005 18:52
Acronimos utiles jafl1965 Humor 7 05/11/2003 10:30


All times are GMT +2. The time now is 20:11.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi