Accueil > > > POPUP EN ASP
POPUP EN ASP
Information sur la source
Description
cette fonction affiche ou ferme un popup ENTREES : URL (adresse de la page à afficher dans le popup : optionnel) NomPopup (nom du popup : optionnel) BarreDesLiens (drapeau indiquant l'affichage ou non de la barre de liens : yes,no : optionnel, par defaut = "no") BarreDesMenus (drapeau indiquant l'affichage ou non de la barre de menu : yes,no : optionnel, par defaut = "no") BarreNav (drapeau indiquant l'affichage ou non de la barre de navigation : yes,no : optionnel, par defaut = "no") BarreDuStatut (drapeau indiquant l'affichage ou non de la barre de statut : yes,no : optionnel, par defaut = "no") ZoneAdresse (drapeau indiquant l'affichage ou non de la zone d'adresse : yes,no : optionnel, par defaut = "no") Ascenseurs (drapeau indiquant l'affichage ou non des scrollings : yes,no,auto : optionnel, par defaut = "no") Dimensionnable (drapeau indiquant si le popup est ou n'est pas redimensionnable : yes,no : optionnel, par defaut = "no") Hauteur (Hauteur du popup en pixels : nombre entier) Largeur (Largeur du popup en pixels : nombre entier) PositionH (Position horizontale en pixels sur l'écran : nombre entier : optionnel, par defaut = 0) PositionV (Position verticale en pixels sur l'écran : nombre entier : optionnel, par defaut = 0) PleinEcran (drapeau indiquant l'affichage plein écran ou non du popup : yes,no : optionnel, par defaut = "no") TitrePopup (Titre du popup : optionnel) Texte (texte à afficher dans le popup : optionnel) Choix (drapeau indiquant l'ouverture ou la fermeture du popup : "0","ouverture","yes" = ouverture, "1","fermeture","no" = fermeture) SORTIES : NEANT
Source
- function PopUp(URL,NomPopup,BarreDesLiens,BarreDesMenus,BarreNav,BarreDuStatut,ZoneAdresse,Ascenseurs,Dimensionnable,Hhauteur,Largeur,PositionH,PositionV,PleinEcran,TitrePopup,Texte,Choix)
- Dim strRetour,sep
-
- sep = " "
- if (BarreDesLiens="") then BarreDesLiens="no" end if
- if (BarreDesMenus="") then BarreDesMenus="no" end if
- if (BarreNav="") then BarreNav="no" end if
- if (BarreDuStatut="") then BarreDuStatut="no" end if
- if (ZoneAdresse="") then ZoneAdresse="no" end if
- if (Ascenseurs="") then Ascenseurs="no" end if
- if (Dimensionnable="") then Dimensionnable="no" end if
- if (Hhauteur="") then Hhauteur="100" end if
- if (Largeur="") then Largeur="250" end if
- if (PositionH="") then PositionH="100" end if
- if (PositionV="") then PositionV="200" end if
- if (PleinEcran="") then PleinEcran="no" end if
- strRetour = "<script language=""JavaScript"">" & vbcrlf
- strRetour = strRetour & sep & "var w;" & vbcrlf
- SELECT CASE LCase(Choix)
- CASE "o","ouverture","yes","0","open"
- strRetour = strRetour & sep & "w = window.open ("""&URL&""",'"&NomPopup&"','directories="&BarreDesLiens&",menubar="&BarreDesMenus&",toolbar="&BarreNav&",status="&BarreDuStatut&",location="&ZoneAdresse&",scrollbars="&Ascenseurs&",resizable="&Dimensionnable&",height="&Hhauteur&",width="&Largeur&",top="&PositionV&",left="&PositionH&",fullscreen="&PleinEcran&"');" & vbcrlf
- strRetour = strRetour & sep & "w.document.write(""<html>"");" & vbcrlf
- IF TitrePopup <> "" THEN
- strRetour = strRetour & sep & "w.document.write(""<TITLE>"&TitrePopup&"</TITLE>"");" & vbcrlf
- END IF
- strRetour = strRetour & sep & "w.document.write(""<body>"");" & vbcrlf
- IF Texte <> "" THEN
- strRetour = strRetour & sep & "w.document.write(""<div align=center>"&Texte&"</div>"");" & vbcrlf
- END IF
- strRetour = strRetour & sep & "w.document.write(""<br>"");" & vbcrlf
- strRetour = strRetour & sep & "w.document.write(""<div align=center><a href='javascript:self.close();'>fermer</a></div>"");" & vbcrlf
- strRetour = strRetour & sep & "w.document.write(""</body>"");" & vbcrlf
- strRetour = strRetour & sep & "w.document.write(""</html>"");" & vbcrlf
- CASE "n","fermeture","no","1","close"
- ' temporisation
- strRetour = strRetour & sep & "temporisateur(1,""FermerFenetre(w)"");" & vbcrlf
- END SELECT
- strRetour = strRetour & "</script>" & vbcrlf
- response.write(strRetour)
- end function
- function PopupSimple(URL,NomPopup,Hhauteur,Largeur,TitrePopup,Texte,Choix)
- PopupSimple = PopUp(URL,NomPopup,"","","","","","","",Hhauteur,Largeur,"","","",TitrePopup,Texte,Choix)
- end function
-
- A ceci, il faut ajouter la fonction JavaScript :
- function temporisateur(seconde,fonction) {
- setTimeout(fonction,seconde*1000);
- }
- function FermerFenetre(NomFenetre){
- if (NomFenetre.document) { NomFenetre.close(); }
- }
- qui permettent de temporiser avant la fermeture du popup
function PopUp(URL,NomPopup,BarreDesLiens,BarreDesMenus,BarreNav,BarreDuStatut,ZoneAdresse,Ascenseurs,Dimensionnable,Hhauteur,Largeur,PositionH,PositionV,PleinEcran,TitrePopup,Texte,Choix)
Dim strRetour,sep
sep = " "
if (BarreDesLiens="") then BarreDesLiens="no" end if
if (BarreDesMenus="") then BarreDesMenus="no" end if
if (BarreNav="") then BarreNav="no" end if
if (BarreDuStatut="") then BarreDuStatut="no" end if
if (ZoneAdresse="") then ZoneAdresse="no" end if
if (Ascenseurs="") then Ascenseurs="no" end if
if (Dimensionnable="") then Dimensionnable="no" end if
if (Hhauteur="") then Hhauteur="100" end if
if (Largeur="") then Largeur="250" end if
if (PositionH="") then PositionH="100" end if
if (PositionV="") then PositionV="200" end if
if (PleinEcran="") then PleinEcran="no" end if
strRetour = "<script language=""JavaScript"">" & vbcrlf
strRetour = strRetour & sep & "var w;" & vbcrlf
SELECT CASE LCase(Choix)
CASE "o","ouverture","yes","0","open"
strRetour = strRetour & sep & "w = window.open ("""&URL&""",'"&NomPopup&"','directories="&BarreDesLiens&",menubar="&BarreDesMenus&",toolbar="&BarreNav&",status="&BarreDuStatut&",location="&ZoneAdresse&",scrollbars="&Ascenseurs&",resizable="&Dimensionnable&",height="&Hhauteur&",width="&Largeur&",top="&PositionV&",left="&PositionH&",fullscreen="&PleinEcran&"');" & vbcrlf
strRetour = strRetour & sep & "w.document.write(""<html>"");" & vbcrlf
IF TitrePopup <> "" THEN
strRetour = strRetour & sep & "w.document.write(""<TITLE>"&TitrePopup&"</TITLE>"");" & vbcrlf
END IF
strRetour = strRetour & sep & "w.document.write(""<body>"");" & vbcrlf
IF Texte <> "" THEN
strRetour = strRetour & sep & "w.document.write(""<div align=center>"&Texte&"</div>"");" & vbcrlf
END IF
strRetour = strRetour & sep & "w.document.write(""<br>"");" & vbcrlf
strRetour = strRetour & sep & "w.document.write(""<div align=center><a href='javascript:self.close();'>fermer</a></div>"");" & vbcrlf
strRetour = strRetour & sep & "w.document.write(""</body>"");" & vbcrlf
strRetour = strRetour & sep & "w.document.write(""</html>"");" & vbcrlf
CASE "n","fermeture","no","1","close"
' temporisation
strRetour = strRetour & sep & "temporisateur(1,""FermerFenetre(w)"");" & vbcrlf
END SELECT
strRetour = strRetour & "</script>" & vbcrlf
response.write(strRetour)
end function
function PopupSimple(URL,NomPopup,Hhauteur,Largeur,TitrePopup,Texte,Choix)
PopupSimple = PopUp(URL,NomPopup,"","","","","","","",Hhauteur,Largeur,"","","",TitrePopup,Texte,Choix)
end function
A ceci, il faut ajouter la fonction JavaScript :
function temporisateur(seconde,fonction) {
setTimeout(fonction,seconde*1000);
}
function FermerFenetre(NomFenetre){
if (NomFenetre.document) { NomFenetre.close(); }
}
qui permettent de temporiser avant la fermeture du popup
Conclusion
Rien de bien compliqué! Vous pouvez modifier le temps de temporisation de fermeture du popup Comme vous le voyez, vous pouvez ouvrir un popup par défaut, ayant les atttributs par défaut sinon, appelez la fonction Popup avec tous les paramètres que vous voulez!
Voici une page asp exemple :
<% function PopUp(URL,NomPopup,BarreDesLiens,BarreDesMenus,Bar reNav,BarreDuStatut,ZoneAdresse,Ascenseurs,Dimensi onnable,Hhauteur,Largeur,PositionH,PositionV,Plein Ecran,TitrePopup,Texte,Choix) Dim strRetour,sep
sep = " " if (BarreDesLiens="") then BarreDesLiens="no" end if if (BarreDesMenus="") then BarreDesMenus="no" end if if (BarreNav="") then BarreNav="no" end if if (BarreDuStatut="") then BarreDuStatut="no" end if if (ZoneAdresse="") then ZoneAdresse="no" end if if (Ascenseurs="") then Ascenseurs="no" end if if (Dimensionnable="") then Dimensionnable="no" end if if (Hhauteur="") then Hhauteur="100" end if if (Largeur="") then Largeur="250" end if if (PositionH="") then PositionH="100" end if if (PositionV="") then PositionV="200" end if if (PleinEcran="") then PleinEcran="no" end if strRetour = "<script language=""JavaScript"">" & vbcrlf strRetour = strRetour & sep & "var w;" & vbcrlf SELECT CASE LCase(Choix) CASE "o","ouverture","yes","0","open" strRetour = strRetour & sep & "w = window.open ("""&URL&""",'"&NomPopup&"','directories="&BarreDe sLiens&",menubar="&BarreDesMenus&",toolbar="&Barre Nav&",status="&BarreDuStatut&",location="&ZoneAdre sse&",scrollbars="&Ascenseurs&",resizable="&Dimens ionnable&",height="&Hhauteur&",width="&Largeur&",t op="&PositionV&",left="&PositionH&",fullscreen="&P leinEcran&"');" & vbcrlf strRetour = strRetour & sep & "w.document.write(""<html>"");" & vbcrlf IF TitrePopup <> "" THEN strRetour = strRetour & sep & "w.document.write(""<TITLE>"&TitrePopup&"< ;/TITLE>"");" & vbcrlf END IF strRetour = strRetour & sep & "w.document.write(""<body>"");" & vbcrlf IF Texte <> "" THEN strRetour = strRetour & sep & "w.document.write(""<div align=center>"&Texte&"</div>"");" & vbcrlf END IF strRetour = strRetour & sep & "w.document.write(""<br>"");" & vbcrlf strRetour = strRetour & sep & "w.document.write(""<div align=center><a href='javascript:self.close();'>fermer</a> ;</div>"");" & vbcrlf strRetour = strRetour & sep & "w.document.write(""</body>"");" & vbcrlf strRetour = strRetour & sep & "w.document.write(""</html>"");" & vbcrlf CASE "n","fermeture","no","1","close" ' temporisation strRetour = strRetour & sep & "temporisateur(1,""FermerFenetre(w)"");" & vbcrlf END SELECT strRetour = strRetour & "</script>" & vbcrlf response.write(strRetour) end function function PopupSimple(URL,NomPopup,Hhauteur,Largeur,TitrePop up,Texte,Choix) PopupSimple = PopUp(URL,NomPopup,"","","","","","","",Hhauteur,L argeur,"","","",TitrePopup,Texte,Choix) end function %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> &l t;TITLE>Acceuil</TITLE> <META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <script language="JavaScript"> <!-- function temporisateur(seconde,fonction) { setTimeout(fonction,seconde*1000); } function FermerFenetre(NomFenetre){ if (NomFenetre.document) { NomFenetre.close(); } } //--> </script> </HEAD> <BOD Y> <% call PopupSimple("","Test","150","300","Ceci est un test","Bonjour toua!","0") call PopupSimple("","Test","","","","","1") %> </ BODY> </HTML>
Sources du même auteur
GESTION DE FICHIER (CRÉER, LIRE, RAJOUTER DES LIGNES,EFFACER...GESTION DE FICHIER (CRÉER, LIRE, RAJOUTER DES LIGNES,EFFACER, DÉTRUIRE) Ben voilà, j'ai fait une fonction utilisant le FILESYSTEMOBJECT qui permet de manipuler des fichiers.
Vous pouvez créer, lire, rajouter des lignes, d...
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Redirection url ASP [ par plka ]
Bonjour à tout le monde.J'ai deux urls que j'ai envie de rediriger par rapport à l'adresse popup qui s'appelle: /popup-login.asp?lng=nl&url=1 une atre
utiliser un paramètre passé en paramètre d'une page à l'autre [ par weejay ]
Bonjour,alors pour mon premier message, j'ai une question TRES, TRES bête. Pardon d'avance, c'est que je débute sous asp.net.Alors j'ai 2 pages : defa
créer des url automatique selon l'utilisateur, style blog [ par wally88 ]
Coucou, je cherche comment faire des liens selon l'utilisateur ou autres infos.exemple ont s'inscrit sur un blog le blog va etre du style http://utili
Récupérer variable csharp dans un objet d'une page aspx [ par weejay ]
Bonjour,j'ai encore une question très très simple.Jai une page page_1.aspx qui ouvre une page popup_player.aspx.page_1.aspx.csstring url = "popup_play
Redimensionner un Popup [ par some_one ]
Bonjour je veux redimensionner un fenetre que j'ai ouvert de maniere suivant: href="javascript:window.showModalDialog('popup.aspx?ID=<%# Eval("id_h
Modal popup Extender [ par exxtaz ]
Bonjour,Le panel que je décide d'afficher en popup grace au control AJAX disparait après moins d'une seconde d'apparition sans intervention de ma part
Comment figer figer la dimension d'une fenêtre. [ par PascalCmoa ]
Bonjour à tous,J'aimerai savoir comment rendre une fenêtre (ie, firefox, ...) non redimensionnable. En fait, je voudrais savoir comment rendre inactif
récupérer une URL dans access [ par nico5969 ]
Hello a tous...eh oui je suis de retour avecune nouvelle question ....je vais finir par payer un coup sur le site moi...Bref....Mon new probleme....Su
problème d'un popup [ par noutazia ]
Bonjour, je developpe sur une application et mon problem est comme suit j'ai un popup qui s'ouvre à partir d'une page mére celui ci comporte un lien p
envoyer une url avec variable et jmail [ par ribeirojose ]
Bonjours à tous.apres une matinée a me prendre la teteje trouve pas ma solutionje part d'une page formulaire.asp simpleavec champ nom mail et mail d'e
|
Derniers Blogs
UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010TECHDAYS PARIS 2010 : LA BI DANS SHAREPOINT 2010 par ROMELARD Fabrice
Animé par: Vincent Bellet et Baptiste Giraudier La BI dans SharePoint 2010, Les nouveaux services d'application dans SP2010 et SQL Server Reporting services 2008 R2. La BI dans SharePoint est généralisée pour tous afin de permettre à tous les coll...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice
Forum
URL REWRITINGURL REWRITING par hudon77
Cliquez pour lire la suite par hudon77
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|