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  |  

Affordable ASP.NET Hosting Service
  Ads  
Engage Software - Training Partner for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
CrystalTech Web Hosting™
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Response.End() doesn't stop processing script?
Previous Previous
 
Next Next
New Post 4/18/2008 11: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 12:07 PM
User is offline Brandon Haynes
701 posts
brandonhaynes.org
7th 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 12:31 PM
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 12:51 PM
User is offline Brandon Haynes
701 posts
brandonhaynes.org
7th 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 4: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.

 


Gearworx Web Hosting
As a premier provider of Web Hosting, Private/White Label hosting, Server Colocation, Dedicated Server, and other Managed Services, Gearworx offers an array of services designed to more effectively manage strategies driving businesses on the Web. Headquartered in Fremont, California our state of the art tier one data centers and distributed managed services environment enables Gearworx to offer your business enterprise level solutions through simplified processes.
Gearworx Web Hosting
Glanton: Enterprise Intranet Specialists Using DNN
Glanton Solutions are a premier provider of sevices for large corporates lloking to outsource Intranet sites.
www.glanton.com
Jetkey Smart Map
Smart Map is an AJAX powered Google Map module that displays driving directions, proximity search results and data from your own databases. Smart Map reads GPX (GPS data) files, GeoRSS feeds, and KML data. You can pass any querystring parameter to Smart Map and into your own custom queries to control what data displays on the map.
smartmap.jetkey.com

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