IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP.NET Discussion :

comment ouvrir une fenetre fille (a partir d'une autre fenetre)


Sujet :

ASP.NET

  1. #1
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut comment ouvrir une fenetre fille (a partir d'une autre fenetre)
    bonsoir,
    comment je peux ouvrir une petite fenetre à partir d'une autre fenetre

  2. #2
    Expert éminent
    Avatar de Immobilis
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Mars 2004
    Messages
    6 559
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Mars 2004
    Messages : 6 559
    Points : 9 506
    Points
    9 506
    Par défaut
    Salut,

    As-tu déjà entendu parler de popup? Une petite recherche de ce terme sur ce forum et Google et tu auras bcp de solutions.

    A+

  3. #3
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    la verité j'entends parler des popup mais je ne savais pas qu'il ya un lien entre popup et fentre fille

  4. #4
    Expert éminent
    Avatar de Immobilis
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Mars 2004
    Messages
    6 559
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Mars 2004
    Messages : 6 559
    Points : 9 506
    Points
    9 506
    Par défaut
    C'est du javascript. Il faut que tu ailles regarder ici: http://dotnet.developpez.com/faq/asp...s_introduction

    Sinon, voici un code pour faire un custom control qui ouvre une popup:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    using System;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.ComponentModel;
    using System.IO;
     
     
    namespace MonNameSpace
    {
     
        [DefaultProperty("Text"),
        ToolboxData("<{0}:PopupButton runat=server Text='Open a popup'></{0}:PopupButton>")]
        public class PopupButton : System.Web.UI.WebControls.Button
        {
            private int m_height;
            private int m_width;
            private String m_url;
            public enum YesNoType { no, yes }
            private YesNoType m_status;
            private YesNoType m_resizable;
            private YesNoType m_scrollbars;
            private YesNoType m_toolbar;
            private YesNoType m_location;
            private YesNoType m_menubar;
            private YesNoType m_modal;
     
            [Bindable(true),
            Category("Appearance"), Description("The URL that will be opened in the popup window")]
            public string PopupURL
            {
                get
                {
                    if (Page != null && (Page.Site == null || !Page.Site.DesignMode))
                    {
                        return Page.Response.ApplyAppPathModifier(m_url);
                    }
                    else
                    {
                        return m_url;
                    }
                }
                set
                {
                    m_url = value;
                }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("This sets the height of the new window in pixels.")]
            public int PopupHeight
            {
                get { return m_height; }
                set { m_height = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("The width of the popup window")]
            public int PopupWidth
            {
                get { return m_width; }
                set { m_width = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes, the new window will have the standard browser status bar at the bottom.")]
            public YesNoType Status
            {
                get { return m_status; }
                set { m_status = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes this allows the resizing of the new window by the user.")]
            public YesNoType Resizable
            {
                get { return m_resizable; }
                set { m_resizable = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes the new window is created with the standard horizontal and vertical scrollbars, where needed")]
            public YesNoType Scrollbars
            {
                get { return m_scrollbars; }
                set { m_scrollbars = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes the new window will have the standard browser tool bar (Back, Forward, etc.).")]
            public YesNoType Toolbar
            {
                get { return m_toolbar; }
                set { m_toolbar = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes, this creates a new browser window with the standard menu bar (File, Edit, View, etc.).")]
            public YesNoType Menubar
            {
                get { return m_menubar; }
                set { m_menubar = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes, this creates the standard Location entry feild in the new browser window.")]
            public YesNoType Location
            {
                get { return m_location; }
                set { m_location = value; }
            }
     
            [Bindable(true),
    Category("Appearance"), Description("When set to yes, this creates a modal popup window.")]
            public YesNoType Modal
            {
                get { return m_modal; }
                set { m_modal = value; }
            }
     
            protected override void AddAttributesToRender(HtmlTextWriter writer)
            {
                String atts = "";
                if (m_modal == YesNoType.yes)
                    atts = "javascript:window.showModalDialog('" + m_url + "','','dialogHeight:" + m_height + "px, dialogWidth:" + m_width + "px, center:yes');";
                else
                    atts = "javascript:window.open('" + PopupURL + "','','height=" + m_height + ", width=" + m_width + ", status=" + m_status.ToString() + ", resizable=" + m_resizable.ToString() + ", scrollbars=" + m_scrollbars.ToString() + ", toolbar=" + m_toolbar.ToString() + ",location=" + m_location.ToString() + ",menubar=" + m_menubar.ToString() + "');";
                writer.AddAttribute("onClick", atts);
                base.AddAttributesToRender(writer);
            }
     
            protected override void OnInit(EventArgs e)
            {
                base.OnInit(e);
                this.CausesValidation = false;
                this.UseSubmitBehavior = false;
            }
        }
    }
    A+

  5. #5
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    merci bien pour le code je vais le tester
    merci une autre fois

  6. #6
    Membre régulier
    Inscrit en
    Décembre 2008
    Messages
    233
    Détails du profil
    Informations personnelles :
    Âge : 37

    Informations forums :
    Inscription : Décembre 2008
    Messages : 233
    Points : 73
    Points
    73
    Par défaut
    le lien que vous m'avez fourni est super utile
    ça fonctionne tres bien
    voila le code

    string url; //url de la popup html
    int largeur; //largeur de la popup
    int hauteur; //hauteur de la popup
    int x; //position en x de la popup
    int y; //position en y de la popup

    //la position en x,y se fait à partir du coin supérieur gauche de la fenêtre
    Response.Write("<body><script>window.open(\"" + url + "\",\"_blank\",\"width=" + largeur +
    ",height=" + hauteur + ",top=" + x + ",left=" + y + "\");</script></body>");


    pour l'autre code j'arrive pas a le maitriser, il me semble un peu comliqué celui ci dessus est simple, bref et surtout efficace

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 3
    Dernier message: 14/08/2012, 10h24
  2. Comment faire pour générer un fichier à partir d'une BD MySQL
    Par dessinateurttuyen dans le forum Requêtes
    Réponses: 2
    Dernier message: 06/07/2006, 20h39
  3. Réponses: 1
    Dernier message: 19/06/2006, 15h46
  4. [rechargement d'une frame mère à partir d'une frame fille]
    Par Lady_jade dans le forum Général JavaScript
    Réponses: 6
    Dernier message: 09/12/2005, 11h02

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo