Forum Moderators: open

Message Too Old, No Replies

Using response.write("...") within a user control...

How Response.write() can be used with user controls

         

bhonda

2:42 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



Hey all,
I've really new to WW, but already learnt so much from all you guys! Just got a quick question, that has been annoying me for a couple of days now. Here is my situation....
I'm working in ASP.NET, and I have a user control. I also have a simple aspx page that contains the user control below some random text. What I would love to happen, is when the user control is loaded up (ie in page_load()) some text is placed at the top of the user control, not the top of the main page. I've played around with Response.Write(), but that places it at the top of the main page. This is a staging point for a dynamic menu idea I'm playing around with, and have tried creating labels and stuff at run-time but I can't get them anywhere apart from the top of the main aspx page!
I appologise if this is a really simple problem, but I just can't figure it out!

Thanks in advance,
J

emsaw

10:38 pm on Jul 6, 2005 (gmt 0)

10+ Year Member



bhonda,

You should be able to place either a Label or a Literal control and set it's .Text to whatever you would like. A little snippet of code would greatly help in understanding what you are trying to do as well. Are you using VB.Net or C#.Net?

-Mark

duckhunter

2:12 am on Jul 7, 2005 (gmt 0)

10+ Year Member



Placeholders work well for UserControls too

bhonda

8:23 am on Jul 7, 2005 (gmt 0)

10+ Year Member



Cheers guys - a placeholder, as it turns out, is EXACTLY what I needed! Ta!

J