[ASCX] Add an ascx in a webcontrol...

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default [ASCX] Add an ascx in a webcontrol...

    hey there,

    ok i made a class, that inherits webcontrol, and i add an htmltable to it. I
    was wondering how to declare an ascx file as an object in my class, like
    that i could change the content (the ascx file) of a cell thanks to a
    property and it would be great :)

    Merci d'avance pour l'aide :)


    Quentin Guest

  2. Similar Questions and Discussions

    1. ASP.NET 2.0 BUG with ASCX controls
      My application runs fine for a long while then, all of a sudden my it starts getting this error pointing to my ascx control in the call stack ...
    2. FormAuthentication on ascx files
      Hi, I have a default.aspx page which has PlaceHolder where it will call different *.acx file based on the request url. eg...
    3. ascx... again :'(
      Hello, I got a Solution, containing two projects, a project of classes, and a web project. The two projects directories are not located in the...
    4. ascx... in a class.vb
      I made a class in an other file than the aspx one. This class is juste an HtmlTable, it looks like a window, and i'd like to add a property to this...
    5. Placehoder and ASCX
      you could pass to your placeholder1 a reference to placeholder2... so from inside placeholder1's ascx u could write something like this: ...
  3. #2

    Default Re: [ASCX] Add an ascx in a webcontrol...

    thank you for your response :)

    But i'm not sure i explained my problem well... I made a class in an other
    file than the aspx one. This class is juste an HtmlTable, it looks like a
    window, and i'd like to add a property to this class as to add an ascx in a
    cell. My english is not so good so let me give you an example.

    --------MesClasses.vb-----------------------

    Public Class MaFenetre : inherits WebControl

    Public Sub New()
    Dim Fenetre As New HtmlTable
    Dim MaLigne As New HtmlTableRow
    Dim MaCellule As New HtmlTableCell
    Dim MyObjectAscx As ?????

    MaCellule.Controls.Add(MyObjectAscx)

    MaLigne.Cells.Add(MaCellule)

    Fenetre.Rows.Add(MaLigne)

    Fenetre.Width = "100%"
    Fenetre.height = "100%"

    Me.Controls.Add(Fenetre)
    End Sub

    Public Property InnerPage As String
    Get
    Return InnerPage
    End Get
    Set(ByVal Value As String)
    InnerPage = Value
    MyObjectAscx.Path = InnerPage
    End Set
    End Property

    End Class

    Where InnerPage is the path of the *.ascx file. But the thing i don't know
    is how to declare the future object that will be the ascx file in my
    class...

    Thank you for your help.

    "Swanand Mokashi" <swanand@swanandmokashi.com> a écrit dans le message de
    news: [email]OVzk3VgVDHA.2164@TK2MSFTNGP10.phx.gbl[/email]...
    > say your custom control is called Menu
    >
    > Add this to the aspx page , to which you want to add the web control
    > <%@ Register TagPrefix="Anything" TagName="Menu" SRC="Menu.ascx"%>
    >
    > now in the page
    > <Anything:Menu runat="server" id="Menu1"/>
    >
    > now in page behind
    > Page.FindControl("Menu1").WhateverPropertyMethod
    >
    >
    > HTH
    > --
    > Swanand Mokashi
    > Microsoft Certified Professional
    > [url]http://www.swanandmokashi.com/[/url]
    > Home of the Stock Quotes, Quote of the day and Horoscope web services
    > "Quentin" <Quentin.Casasnovas@wanadoo.Fr> wrote in message
    > news:ujobPjeVDHA.2288@TK2MSFTNGP12.phx.gbl...
    > > hey there,
    > >
    > > ok i made a class, that inherits webcontrol, and i add an htmltable to
    it.
    > I
    > > was wondering how to declare an ascx file as an object in my class, like
    > > that i could change the content (the ascx file) of a cell thanks to a
    > > property and it would be great :)
    > >
    > > Merci d'avance pour l'aide :)
    > >
    > >
    >
    >

    Quentin Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

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 139