Usercontrol in a placeholder

G

Guest

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
 
J

Joshua Mitts

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.
 
G

Guest

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
 
E

Emil Christopher Melar

Pradeep said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top