Usercontrol in a placeholder

Discussion in 'ASP .Net' started by =?Utf-8?B?UHJhZGVlcA==?=, Nov 2, 2005.

  1. Hi,
    I am having this wierd issue. I have a usercontrol in a aspx page.
    Basically this user control has some labels and thats it. It has a printer
    friendly link and when we click on it a pop up window open with the text the
    user control. Everything works good except for in hte labels, where I have
    long text. When looked in teh aspx page, i see <br /> at quite some places
    and somehow all of them magically disappear when on this printer friendly
    page.

    this is what I am doing....

    PrintMessagePlaceHolder.Controls.Add(
    LoadControl(GetUrl(Constants.PRINT_MESSAGE_GENERAL)));

    Please let me know.

    Thanks
    Pradeep
     
    =?Utf-8?B?UHJhZGVlcA==?=, Nov 2, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?UHJhZGVlcA==?=

    Joshua Mitts Guest

    Hi Pradeep,

    Can you post examples of the two different outputs and the code that is
    generating each? I don't understand from your code how the printer-friendly
    page is generated.

    --

    Joshua Mitts


    "Pradeep" <> wrote in message
    news:...
    > Hi,
    > I am having this wierd issue. I have a usercontrol in a aspx page.
    > Basically this user control has some labels and thats it. It has a printer
    > friendly link and when we click on it a pop up window open with the text
    > the
    > user control. Everything works good except for in hte labels, where I have
    > long text. When looked in teh aspx page, i see <br /> at quite some places
    > and somehow all of them magically disappear when on this printer friendly
    > page.
    >
    > this is what I am doing....
    >
    > PrintMessagePlaceHolder.Controls.Add(
    > LoadControl(GetUrl(Constants.PRINT_MESSAGE_GENERAL)));
    >
    > Please let me know.
    >
    > Thanks
    > Pradeep
     
    Joshua Mitts, Nov 2, 2005
    #2
    1. Advertising

  3. Let me explain a bit clearly. I have a ascx control in my aspx page. Within
    the ascx controls, I have multiple lables. For one of the labels I have text
    which is multi-line like eg. suppose I have 3 paragraphs of text. Now when
    this is displayed in the aspx page, in teh View Source I can see <br />'s at
    the end of each paragraphs and/or line. But this ascx control also has a
    hyperlink which actually opens a pop up window and uses the below code to put
    the usercontrol in a placeholder. And now all the paragraphns of the text
    about are in one paragraph. All the ohter tags are still there... like the
    ones of <td> etc but dont' see any <br />s.

    Let me know a solution. Or let me know what is a good way of putting a
    usercontrol text into a page. Thanks in advance.

    Pradeep

    "Joshua Mitts" wrote:

    > Hi Pradeep,
    >
    > Can you post examples of the two different outputs and the code that is
    > generating each? I don't understand from your code how the printer-friendly
    > page is generated.
    >
    > --
    >
    > Joshua Mitts
    >
    >
    > "Pradeep" <> wrote in message
    > news:...
    > > Hi,
    > > I am having this wierd issue. I have a usercontrol in a aspx page.
    > > Basically this user control has some labels and thats it. It has a printer
    > > friendly link and when we click on it a pop up window open with the text
    > > the
    > > user control. Everything works good except for in hte labels, where I have
    > > long text. When looked in teh aspx page, i see <br /> at quite some places
    > > and somehow all of them magically disappear when on this printer friendly
    > > page.
    > >
    > > this is what I am doing....
    > >
    > > PrintMessagePlaceHolder.Controls.Add(
    > > LoadControl(GetUrl(Constants.PRINT_MESSAGE_GENERAL)));
    > >
    > > Please let me know.
    > >
    > > Thanks
    > > Pradeep

    >
    >
    >
     
    =?Utf-8?B?UHJhZGVlcA==?=, Nov 3, 2005
    #3
  4. Pradeep wrote:
    > Hi,
    > I am having this wierd issue. I have a usercontrol in a aspx page.
    > Basically this user control has some labels and thats it. It has a printer
    > friendly link and when we click on it a pop up window open with the text the
    > user control. Everything works good except for in hte labels, where I have
    > long text. When looked in teh aspx page, i see <br /> at quite some places
    > and somehow all of them magically disappear when on this printer friendly
    > page.
    >
    > this is what I am doing....
    >
    > PrintMessagePlaceHolder.Controls.Add(
    > LoadControl(GetUrl(Constants.PRINT_MESSAGE_GENERAL)));
    >
    > Please let me know.
    >
    > Thanks
    > Pradeep


    You don't tell us on what event this control is loaded.

    You have to remember that you have to re-add the control at each load,
    because asp.net doesn't keep track of what controls you have added to
    the hierarchy.

    --
    Emil Christopher Melar
     
    Emil Christopher Melar, Nov 3, 2005
    #4
    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. Ben de Vette

    Placeholder and UserControl

    Ben de Vette, Jul 11, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    8,660
    Ben de Vette
    Jul 12, 2004
  2. Anders K. Jacobsen [DK]

    Problem access usercontrol added to placeholder

    Anders K. Jacobsen [DK], Mar 8, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    519
    Anders K. Jacobsen [DK]
    Apr 1, 2005
  3. dkode
    Replies:
    0
    Views:
    416
    dkode
    Apr 25, 2006
  4. David Lozzi

    Accessing usercontrol in placeholder

    David Lozzi, Oct 13, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    602
    David Lozzi
    Oct 14, 2006
  5. nail

    Build control in a placeholder or like a placeholder

    nail, Sep 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    352
Loading...

Share This Page