User control's Response

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I have a page default.aspx and lots of user controls (Top.ascx,
LeftNav.ascx, Page1Content.ascx, Page2Content.ascx...). The default.aspx
contains Top.ascx, LeftNav.ascx at design time, and dynamically loads
PageNContent.ascx based on user's selection. That is if user select
Page1->Page1Content.ascx is loaded at run-time....

In Page1Content.ascx, if I have Response.write("...."), this will write the
output on top of the output html page. How can I write data to within the
Content area? What I ultimately want to achieve is, for all pages, Top &
LeftNav are always the same, the content of each page is data-driven from DB
and presented using CSS within the "Content" area.

Thanks.
 
Don't use Response.Write. This is the old ASP way which doesn't work in
ASP.Net as ASP.Net is event driven. You need to use the appropriate control
to place your text into. You can add a Label control and then place the
output into the Label's Text property.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Mark,

I do have labels as you said and that solution works well. However, the
reason I want to use Response.Write() [for some other text output] is to
apply Presentation rules using CSS or xslt on them, unless there's a better
design solution that allows users change the presentation using configuration
tool.

Thanks.
 
Hi,

You can do that with label also. If you explain in detail, I may help u.

Prakash.C

mtv said:
Mark,

I do have labels as you said and that solution works well. However, the
reason I want to use Response.Write() [for some other text output] is to
apply Presentation rules using CSS or xslt on them, unless there's a better
design solution that allows users change the presentation using configuration
tool.

Thanks.


Mark Fitzpatrick said:
Don't use Response.Write. This is the old ASP way which doesn't work in
ASP.Net as ASP.Net is event driven. You need to use the appropriate control
to place your text into. You can add a Label control and then place the
output into the Label's Text property.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
Prakash:

What I want to do is: on each page, I'll have a Top banner, Left nav, Bottom
banner and Content section in between. So, I built each "area" as a control
(Top.ascx...).

The content gets data from database and has its own CSS for presentation (if
not, use default CSS). Data has 2 types of data: business data (BD) and
webpage content data (WCD). BD is like account info, user name/addr, Job
openings, etc.. WCD is like Our Service info, Career Intro, Page intro....
Users have a Content Management Tool that can edit page CSS and WCD. WCD may
even have html tags in it like links, email...

When loading a page, both BD and WCD avail to the page are loaded and
presented based on CSS. At this time, I don't think it's reasonable to have
only CSS dictate the look of the returned page; only some areas in the
Content are. I have not found the balance between designed presentation and
configured presentation (CSS changed by users). What's the best way to do to
accomplish this? How would you design this requirement?

Thanks.


Prakash.NET said:
Hi,

You can do that with label also. If you explain in detail, I may help u.

Prakash.C

mtv said:
Mark,

I do have labels as you said and that solution works well. However, the
reason I want to use Response.Write() [for some other text output] is to
apply Presentation rules using CSS or xslt on them, unless there's a better
design solution that allows users change the presentation using configuration
tool.

Thanks.


Mark Fitzpatrick said:
Don't use Response.Write. This is the old ASP way which doesn't work in
ASP.Net as ASP.Net is event driven. You need to use the appropriate control
to place your text into. You can add a Label control and then place the
output into the Label's Text property.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage

Hi all,

I have a page default.aspx and lots of user controls (Top.ascx,
LeftNav.ascx, Page1Content.ascx, Page2Content.ascx...). The default.aspx
contains Top.ascx, LeftNav.ascx at design time, and dynamically loads
PageNContent.ascx based on user's selection. That is if user select
Page1->Page1Content.ascx is loaded at run-time....

In Page1Content.ascx, if I have Response.write("...."), this will write
the
output on top of the output html page. How can I write data to within the
Content area? What I ultimately want to achieve is, for all pages, Top &
LeftNav are always the same, the content of each page is data-driven from
DB
and presented using CSS within the "Content" area.

Thanks.
 
Back
Top