Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

Maximum ASP
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
OnyakTech
 


  Sponsors  

Meet Our Sponsors

Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
MadCap Software, Inc.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Response.End() doesn't stop processing script?
Previous Previous
 
Next Next
New Post 4/18/2008 10:24 AM
Unresolved
User is offline Cynthia
9 posts
10th Ranked


Response.End() doesn't stop processing script? 

I've develop a module that will offer RSS xml file on fly when user click the  icon. What I want is a page showing items in XML format. Just like what I can get in the Blog Module. Here is what I did, I create a user control StoryFeed.ascx, which inherites from class DotNetNuke.Entities.Modules.PortalModuleBase.  Here is my code in StoryFeed.ascx .cs.

protected void Page_Load(object sender, EventArgs e)

{

    //Get data from database, put them in a RssChannel class 
    RssChannel rss = GetChannel(); 
   
    Response.Clear();
    Response.ClearContent();
    Response.ContentEncoding = System.Text.Encoding.UTF8;
    Response.ContentType = "application/xml";

    //Using XmlTextWriter to output the result  
    rss.Write(Response.OutputStream);
   
    //End processing of the script
    Response.End();

}

However, I can't see it in the xml format because after the "<rss>....</rss>" text, there followed "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">....". It seems the Response.End() doesn't stop processing the script. How can I stop process the pipeline after I retrieved data and output them to the stream? I googled on Response.End() and found a piece on Rick Strahl's blog, I tried CompleteRequest() but no luck.

Anyone have the same problem? Need help on this.

 

 

 

 

 
New Post 4/18/2008 11:07 AM
User is offline Brandon Haynes
461 posts
everysport.net
8th Ranked


Re: Response.End() doesn't stop processing script? 

Hi Cynthia,

Nothing immediate jumps out at me, but I'll take a stab in the dark -- do you perhaps also need a Response.ClearHeaders() call when reseting the response buffer?

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 4/18/2008 11:31 AM
User is offline Cynthia
9 posts
10th Ranked


Re: Response.End() doesn't stop processing script? 

Brandon,

I tried add Response.ClearHeaders() but no luck. Here is what I did,

 

{

    ....

                Response.Clear();
                Response.ClearContent();
                Response.ClearHeaders();            
                Response.ContentEncoding = System.Text.Encoding.UTF8;
                Response.ContentType = "text/xml";                  


                rss.Write(Response.OutputStream);
               
                Response.End(); 

}

 

And this is what I got,

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.


Cannot have a DOCTYPE declaration outside of a prolog. Error processing resource 'http://localhost/dnn40/Mymodule/tabi...

</rss><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
----------------^
protected void Page_Load(object sender, EventArgs e)

 
New Post 4/19/2008 11:51 AM
User is offline Brandon Haynes
461 posts
everysport.net
8th Ranked


Re: Response.End() doesn't stop processing script? 

Hi Cynthia,

Even as I wrote my response I couldn't help but think a ClearHeaders() call probably wouldn't do much good. 

Is the DOCTYPE declaration the only tag that's causing your page problems, or only the first?  If you were to toggle the DOCTYPE visibility (via Default.ascx.vb), would that (temporarily) rectify the problem, or would the next tag in line cause yet another problem?

The reason I ask is because, if the problem is only with the DOCTYPE, you might be able to just band-aid in fix.  If not, the solution will likely be more involved.

Brandon


Brandon Haynes
BrandonHaynes.org
 
New Post 5/12/2008 3:28 AM
User is offline Mr T
4 posts
10th Ranked


Re: Response.End() doesn't stop processing script? 

Hi Cynthia,

Did you work out how to do this? 

I'm having the same difficulty!

Thanks,

Richard

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Response.End() doesn't stop processing script?
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Module Development by Engage Software
Specializing in custom module development, training and skinning.
www.engagesoftware.com
BataviaSoft DotNetNuke Solutions
BataviaSoft offers custom DotNetNuke solutions especially for the European and the South East Asian market.
www.bataviasoft.com
Viva Portals, L.L.C.
Expert module development and graphic design.
www.continure.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP