Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Response.Write - content appears outside the moduleResponse.Write - content appears outside the module
Previous
 
Next
New Post
6/10/2008 5:12 PM
 

Hello,

I am working with VS 2005 and C#. I am using the commands

Response.ContentType = "text/html";
Response.Write(HtmlTags);

But the output of this Response.Write appears outside my module, how can I solve it?

Thanks in advance,

Kau.

 
New Post
6/10/2008 7:07 PM
 

I recommend you add a placeholder or label control and write your content to one of them - if you just push content to the response stream it appears at the point of execution, you don't have sufficent control of it's placement.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
6/10/2008 7:55 PM
 

Hi Kau,

You are almost certainly executing the Write method before any controls have had a chance to render themselves (in the Render phase of the page lifecycle).  This would be expected if the statement were executed in the PreInit, Init, Load, or PreRender methods.  You can read more about the ASP.NET page lifecycle here: http://msdn.microsoft.com/en-us/library/ms178472.aspx.

You could implement a custom rendering behavior in your control to get the string in the place you're looking for, but this may or may not be the best way to accomplish the task.  It's probably not -- you'll almost certainly want to use a placeholder as Cathal suggested.

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post
6/11/2008 1:24 PM
 

Hello,

Thank you for answer, but it doesn't works out fine. I have a html code more or less like this:

 

test = "<FORM ACTION='cgi-bin/formmail.pl' METHOD='POST'>" +"<INPUT TYPE='HIDDEN' NAME='Name' VALUE='name' SIZE='25' MAXLENGTH='50'>" +"<INPUT TYPE='HIDDEN' NAME='Email' VALUE='email' SIZE='25' MAXLENGTH='50'>" +"<INPUT TYPE='SUBMIT' NAME='name' VALUE='label'>'";

The button appears but, after I pressed it the post never ends. Could you help?

Thanks in advance,

Kau.

string

 
New Post
6/11/2008 3:07 PM
 

First off, Response.Write is practically nothing more than a debugging tool with ASP.NET.  You almost never want to write directly to the response stream; you want to inject your content into controls that are placed throughout the page.

What do you mean when you say "the post never ends"?  Does the request time out?  Do you get an error?

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Response.Write - content appears outside the moduleResponse.Write - content appears outside the module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out