dynamically loading custom control????

Discussion in 'ASP .Net Web Controls' started by Farooq Khan, Dec 24, 2003.

  1. Farooq Khan

    Farooq Khan Guest

    hi,
    i have designed my own control having a public property. i want to be able
    to set that property as the page, having that control in it, loads.
    the inline code for the page is (assuming MyControl is the TagPrefix and
    Control1 is the TagName and MyProperty being string type property):

    <MyControl:Control1 id="someID" MyProperty="<%
    Response.Write(Request.QueryString["SomeValue"].ToString()); %>
    runat="server" >
    </MyControl:Control1>

    second how can i dynamically add different no. of such controls.

    Thanks.

    Best regards,
    Farooq Khan
     
    Farooq Khan, Dec 24, 2003
    #1
    1. Advertising

  2. Farooq Khan

    Michel Guest

    Hi Farooq,

    You can use LoadControl method and pass it the name of the ascx (e.g.
    LoadControl("myControl.ascx").

    Hope this helps,
    Michel

    "Farooq Khan" <> wrote in message
    news:...
    > hi,
    > i have designed my own control having a public property. i want to be able
    > to set that property as the page, having that control in it, loads.
    > the inline code for the page is (assuming MyControl is the TagPrefix and
    > Control1 is the TagName and MyProperty being string type property):
    >
    > <MyControl:Control1 id="someID" MyProperty="<%
    > Response.Write(Request.QueryString["SomeValue"].ToString()); %>
    > runat="server" >
    > </MyControl:Control1>
    >
    > second how can i dynamically add different no. of such controls.
    >
    > Thanks.
    >
    > Best regards,
    > Farooq Khan
    >
    >
     
    Michel, Dec 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?V2FubmFiZV9HZWVr?=

    Custom Control Add Control Dynamically.

    =?Utf-8?B?V2FubmFiZV9HZWVr?=, Jun 30, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    411
    John Saunders
    Jun 30, 2004
  2. Jonah Olsson
    Replies:
    1
    Views:
    588
    Scott Allen
    Apr 5, 2005
  3. Replies:
    0
    Views:
    416
  4. Cramer
    Replies:
    0
    Views:
    352
    Cramer
    Apr 4, 2008
  5. Matt Sokol
    Replies:
    2
    Views:
    409
    Theo Tillotson
    Aug 7, 2003
Loading...

Share This Page