• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 275
  • Last Modified:

How to call a panel and a web user control from teh server side? I am using c#

Hi Experts!
I have a web user control called "WebUserControl.asxc" .Also I hace a page called"home.aspx".
I am trying to create  a "Panel" control from the  codebehind in"home.aspx" that can called "WebUserControl.asxc".

This is What I have so far...I create a panel and I give it an ID(Is this right?), now I need to call the webusercontrol and set it up inside the panel, how can I so this ? :
        Panel stepPanel = null;
        stepPanel.ID = "PanelInside";

Thanks!
0
eddyperu
Asked:
eddyperu
1 Solution
 
eddyperuAuthor Commented:
This is the answer for aybody out there:
        Panel pnlECPopUp = new Panel();
        pnlECPopUp.ID = "pnlECPopUp";
        pnlECPopUp.CssClass = "modalPopup";
       // pnlECPopUp.Style.Value = "display: none";


        Control myControl = (Control)Page.LoadControl("controls/Exampletry.ascx");
        pnlECPopUp.Controls.Add(myControl);
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now