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

Développement Web avec .NET Discussion :

Iframe en codebehind


Sujet :

Développement Web avec .NET

  1. #1
    Membre à l'essai
    Inscrit en
    Janvier 2010
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 15
    Points : 10
    Points
    10
    Par défaut Iframe en codebehind
    Bonjour, je developpe actuellement un site internet pour une société en asp.net C# et je voudrais savoir comment je pourrais généré en code behind un control genre IFrame ??

    Merci d'avance pour vos réponse ...

  2. #2
    Membre éprouvé
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    826
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2006
    Messages : 826
    Points : 1 120
    Points
    1 120
    Par défaut
    Salut,

    tu peux utiliser HtmlGenericControl. Il n'y a pas d'objet plus spécifique.

  3. #3
    Expert éminent sénior

    Avatar de Philippe Vialatte
    Homme Profil pro
    Architecte technique
    Inscrit en
    Juillet 2004
    Messages
    3 029
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Architecte technique
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juillet 2004
    Messages : 3 029
    Points : 12 465
    Points
    12 465
    Par défaut
    Salut,


    le plus simple, dans ton cas, serait d'ajouter un controle de type literal dans ta page, et de placer dans son attribut Text (ou value, je ne sais plus) le code html pour ton Iframe

    tu peux utiliser HtmlGenericControl. Il n'y a pas d'objet plus spécifique.
    De ce que j'ai compris, si c'est pour génerer "dynamiquement" une Iframe, il n'est meme pas question de placer l'Iframe avant rendu dans la page, ce qui serait un pré-requis pour l'utiliser sous forme de controle generique

    Mon Blog

    The Cake is still a lie !!!



    Vous voulez contribuer à la rubrique .NET ? Contactez-moi par MP.
    Vous voulez rédiger des articles pour la rubrique .NET ? Voici la procédure à suivre.

  4. #4
    Membre à l'essai
    Inscrit en
    Janvier 2010
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 15
    Points : 10
    Points
    10
    Par défaut
    merci pour les reponses ... le probleme c que quand je genère le literal que dois mettre dans monlitteral.mode ??? parce que si je met rien à l'affichage j'ai rien qui s'affiche ca fait bugger le chargement de la page
    voila mon code de génération:
    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
     public void generationtabcontain()
            {
                AjaxControlToolkit.TabContainer tc = new AjaxControlToolkit.TabContainer();
                tc.ID = "TabContainer1";
                tc.ActiveTabIndex = 0;
                Unit u = new Unit(100, UnitType.Percentage);
                tc.Width = u;
                tc.BackColor = System.Drawing.Color.Transparent;
     
                foreach (var item in Listcategorie)
    	            {
                        AjaxControlToolkit.TabPanel tp = new AjaxControlToolkit.TabPanel();
     
                        tp.ID = "tp" + item.NomCategorie;
                        tp.CssClass = "TPSolution";
                        tp.HeaderText = item.NomCategorie;
     
                        AjaxControlToolkit.TabContainer tc2 = new AjaxControlToolkit.TabContainer();
                        tc2.ID = "tabcontainer" + item.NomCategorie;
                        tc2.ActiveTabIndex = 0;
     
                        foreach (var element in CS.RecupSolution2(4, item.IdCategorie))
                        {
                            AjaxControlToolkit.TabPanel tp2 = new AjaxControlToolkit.TabPanel();
                            tp2.ID = "tp2" + element.SolutionID;
                            tp2.HeaderText = element.SolutionTitre;
     
                            HtmlAnchor a = new HtmlAnchor();
                            a.ID = "pleinepage" + element.SolutionID;
                            a.HRef = "../../"+element.SolutionLien;
                            a.Target = "_blank";
                            a.Style["float"] = "right";
                            a.Style["font-size"] = "small";
                            a.InnerText = "Pour lire le document en pleine page cliquer ici...";
                            tp2.Controls.Add(a);
     
                            Literal Lit = new Literal();
                            Lit.Text = "<iframe id='frame" + element.SolutionID + "' src='" + element.SolutionLien + " width='100%' height='100%' />";
     
                            tp2.Controls.Add(Lit);
                            tc2.Controls.Add(tp2);
                        }
     
                        tp.Controls.Add(tc2);
                        tc.Controls.Add(tp);                    
    	            }
     
                this.contenaire.Controls.Add(tc);
            }
    petite précision effectivement il s'agit de généré, et j'en génère plusieurs (enfin j'aimerai bien ! lol!)

  5. #5
    Membre éprouvé
    Profil pro
    Inscrit en
    Juin 2006
    Messages
    826
    Détails du profil
    Informations personnelles :
    Âge : 41
    Localisation : France, Paris (Île de France)

    Informations forums :
    Inscription : Juin 2006
    Messages : 826
    Points : 1 120
    Points
    1 120
    Par défaut
    il manque pas un quote ici ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    Lit.Text = "<iframe id='frame" + element.SolutionID + "' src='" + element.SolutionLien + " width='100%' height='100%' />";

  6. #6
    Membre à l'essai
    Inscrit en
    Janvier 2010
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 15
    Points : 10
    Points
    10
    Par défaut
    meme en rajoutant la cote qui manque je me trouve avec la moitié de master page qui se charge et mes controls n'apparaissent pas

    si je met la génération du literal en commentaire ca marche je ne sais pas comment faire

    need a little help, yet ...

  7. #7
    Expert éminent sénior

    Avatar de Philippe Vialatte
    Homme Profil pro
    Architecte technique
    Inscrit en
    Juillet 2004
    Messages
    3 029
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Alpes Maritimes (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Architecte technique
    Secteur : High Tech - Produits et services télécom et Internet

    Informations forums :
    Inscription : Juillet 2004
    Messages : 3 029
    Points : 12 465
    Points
    12 465
    Par défaut
    Citation Envoyé par Namzicos Voir le message
    meme en rajoutant la cote qui manque je me trouve avec la moitié de master page qui se charge et mes controls n'apparaissent pas
    Regarde dans le code source de ta page le code html qui est rendu

    Mon Blog

    The Cake is still a lie !!!



    Vous voulez contribuer à la rubrique .NET ? Contactez-moi par MP.
    Vous voulez rédiger des articles pour la rubrique .NET ? Voici la procédure à suivre.

  8. #8
    Membre à l'essai
    Inscrit en
    Janvier 2010
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 15
    Points : 10
    Points
    10
    Par défaut
    voilà le code généré dans le navigateur:
    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
     
            <div id="ctl00_DivCentrale" style="background:url(../../Resources/WebFili.jpg);background-repeat:repeat-y;">
     
        <div id="decriptionDomaine">
            <table>
                <tr>
                    <td style="width: 100%" rowspan="2">
     
                        <span id="ctl00_ContentPlaceHolder1_NomduDomaine">Solution de Gestion</span>
                    </td>
                </tr>
                <tr>
                    <td style="width: 50%">
                        <img alt="Pas d'image" src="../../" width="100%" height="100%" />
                    </td>
                    <td style="width: 50%">
     
                        <span id="ctl00_ContentPlaceHolder1_DescriptionDuDomaine"></span>
                    </td>
                </tr>
            </table>
        </div>
        <div id="ctl00_ContentPlaceHolder1_contenaire">
        <div id="ctl00_ContentPlaceHolder1_TabContainer1" class="ajax__tab_xp" style="width:100%;visibility:hidden;">
    	<div id="ctl00_ContentPlaceHolder1_TabContainer1_header">
    		<span id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment">Batiment</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpTransport">Transport</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce">Negoce</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique">Mecanique</span></span></span></span>
     
    	</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_body">
    		<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment" class="ajax__tab_panel">
    			<div class="ajax__tab_xp" id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment" style="visibility:hidden;">
    				<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_header">
    					<span id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp247_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp247">Gestion Commerciale ApiBâtiment</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp248_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp248">Comptabilité ApiBâtiment</span></span></span></span>
    				</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_body">
    					<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp247" class="ajax__tab_panel">
    						<a href="../../LogoSolutionProduit/Gestion Commerciale Apibâtiment.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp247_pleinepage47" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame47' src='../../LogoSolutionProduit/Gestion Commerciale Apibâtiment.htm' width='100%' height='100%'/>
    					</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp248" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    						<a href="../../LogoSolutionProduit/Comptabilité Apibâtiment.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpBatiment_tabcontainerBatiment_tp248_pleinepage48" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame48' src='../../LogoSolutionProduit/Comptabilité Apibâtiment.htm' width='100%' height='100%'/>
    					</div>
    				</div>
    			</div>
    		</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    			<div class="ajax__tab_xp" id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport" style="visibility:hidden;">
    				<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_header">
    					<span id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_tp251_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_tp251">Gestion Transport</span></span></span></span>
    				</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_body">
    					<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_tp251" class="ajax__tab_panel">
    						<a href="../../LogoSolutionProduit/Rubrique Transport site Web.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpTransport_tabcontainerTransport_tp251_pleinepage51" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame51' src='../../LogoSolutionProduit/Rubrique Transport site Web.htm' width='100%' height='100%'/>
    					</div>
    				</div>
    			</div>
    		</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    			<div class="ajax__tab_xp" id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce" style="visibility:hidden;">
    				<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_header">
    					<span id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp249_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp249">Gestion Commerciale ApiNégoce</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp250_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp250">Comptabilité ApiNégoce</span></span></span></span>
    				</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_body">
    					<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp249" class="ajax__tab_panel">
    						<a href="../../LogoSolutionProduit/Gestion commerciale Apinegoce.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp249_pleinepage49" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame49' src='../../LogoSolutionProduit/Gestion commerciale Apinegoce.htm' width='100%' height='100%'/>
    					</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp250" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    						<a href="../../LogoSolutionProduit/Comptabilité Apinegoce.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpNegoce_tabcontainerNegoce_tp250_pleinepage50" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame50' src='../../LogoSolutionProduit/Comptabilité Apinegoce.htm' width='100%' height='100%'/>
    					</div>
    				</div>
    			</div>
    		</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    			<div class="ajax__tab_xp" id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique" style="visibility:hidden;">
    				<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_header">
    					<span id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp244_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp244">Gestion Commerciale ApiMécanique Automobile</span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp245_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp245">Comptabilité ApiMécanique </span></span></span></span><span id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp246_tab"><span class="ajax__tab_outer"><span class="ajax__tab_inner"><span class="ajax__tab_tab" id="__tab_ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp246">Gestion Commerciale ApiMécanique Motoculture</span></span></span></span>
    				</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_body">
    					<div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp244" class="ajax__tab_panel">
    						<a href="../../LogoSolutionProduit/Gestion Commerciale Apimecanique Automobile.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp244_pleinepage44" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame44' src='../../LogoSolutionProduit/Gestion Commerciale Apimecanique Automobile.htm' width='100%' height='100%'/>
    					</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp245" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    						<a href="../../LogoSolutionProduit/Comptabilité Apimecanique.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp245_pleinepage45" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame45' src='../../LogoSolutionProduit/Comptabilité Apimecanique.htm' width='100%' height='100%'/>
    					</div><div id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp246" class="ajax__tab_panel" style="display:none;visibility:hidden;">
    						<a href="../../LogoSolutionProduit/Gestion Commerciale Apimecanique Motoculture.htm" id="ctl00_ContentPlaceHolder1_TabContainer1_tpMecanique_tabcontainerMecanique_tp246_pleinepage46" target="_blank" style="float:right;font-size:small;">Pour lire le document en pleine page cliquer ici...</a><iframe id='frame46' src='../../LogoSolutionProduit/Gestion Commerciale Apimecanique Motoculture.htm' width='100%' height='100%'/>
    					</div>
    				</div>
    			</div>
    		</div>
    	</div>
    </div></div>
    est ce vraiment le fait qu'il est des ' a place de "" qui plante tout ??

  9. #9
    Membre à l'essai
    Inscrit en
    Janvier 2010
    Messages
    15
    Détails du profil
    Informations forums :
    Inscription : Janvier 2010
    Messages : 15
    Points : 10
    Points
    10
    Par défaut
    Bon j'ai trouvé avec litéral sans préciser de mode ça marche c juste que dans mon code je fermé la balise iframe comme ça /> alors qu'il faut la fermer comme ça </iframe>

    voilà c gagné !!
    merci de votre aide précieuse elle m'a amener royalement sur la voie
    encore merci !

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

Discussions similaires

  1. Rafraichissement periodique d'une iframe
    Par fxp17 dans le forum Général JavaScript
    Réponses: 5
    Dernier message: 04/01/2012, 17h56
  2. session, <iframe> et sécurité
    Par debie1108 dans le forum ASP
    Réponses: 16
    Dernier message: 22/05/2006, 11h57
  3. probleme avec IFRAME
    Par adilou1981 dans le forum Balisage (X)HTML et validation W3C
    Réponses: 4
    Dernier message: 24/08/2005, 09h34
  4. Réponses: 7
    Dernier message: 17/12/2004, 18h47
  5. [jsp][struts] paramètre dans un iframe.
    Par ultimax dans le forum Servlets/JSP
    Réponses: 3
    Dernier message: 12/10/2004, 09h25

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