Results 1 to 3 of 3

Thread: [RESOLVED] how to embed usercontrol to my web form

  1. #1

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Resolved [RESOLVED] how to embed usercontrol to my web form

    hi,

    Im using c# 2005 . In my web app I have a usercontrol but i can not make a instance of it. Why?


    Thanks,

    Popskie

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: how to embed usercontrol to my web form

    I'll wager noone could tell you with so little information. A UserControl is just a control like any other, so if you've created it properly then there's no reason that you shouldn't be able to create an instance. Is it a WinForms control instead of a WebForms control? Is it in a different project that you haven't added a reference to? Your question is akin to "I have a car but I can't drive it. Why?". Could you answer that?
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member popskie's Avatar
    Join Date
    Jul 2005
    Location
    In my chair
    Posts
    666

    Re: how to embed usercontrol to my web form

    Ok JM . Its web Usercontrol. Sorry for my to much but even I it did not popup in my intellisense i got no error. But the problem is no control was created during i run my my web up.

    VB Code:
    1. protected void Page_Load(object sender, EventArgs e)
    2.         {
    3.            
    4.             UCquestion uc = new UCquestion();            
    5.             Panel1.Controls.Add(uc);
    6. }


    my usercontros consist of 3 radionbutton and 1 label. No code was add. just a simple usercontrol Jm.

    thanks,

    Popskie

Posting Permissions

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



Click Here to Expand Forum to Full Width