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  |  

DotNetNuke Marketplace
  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Configure It! (...  DNN 4.5.3 JavaScript Issue I Think
Previous Previous
 
Next Next
New Post 5/8/2008 7:42 PM
User is offline Tigris7
165 posts
9th Ranked


DNN 4.5.3 JavaScript Issue I Think 

I have buit a simple  custom module that allows a user to click a calendar date in order to stream a file to his/her browser. I use the code below to stream the file.

The streaming works well and all, but if for instance I select 'Logout' after the file is downloaded, instead of logging out it wants to stream the file again. And the same thing occurs if I want to change the to another month in the calendar. If I browse to the Home page then I can logout successfully or return to the page to switch months in the calendar.

 

 

 

 

 

 

 

System.Web.HttpContext.Current.Response.Clear();System.Web.HttpContext.Current.Response.ClearHeaders();System.Web.HttpContext.Current.Response.ClearContent();System.Web.HttpContext.Current.Response.AddHeader("Content-disposition", "attachment; filename=" + fileName);System.Web.HttpContext.Current.Response.ContentType = "application/pdf";System.Web.HttpContext.Current.Response.BinaryWrite(results);HttpContext.Current.ApplicationInstance.CompleteRequest();

 
New Post 5/9/2008 8:10 AM
User is offline Tigris7
165 posts
9th Ranked


Re: DNN 4.5.3 JavaScript Issue I Think 

Anyone?

Essentially, after the file is streamed to the browser, in order to have the logout button or calendar work correctly, I have to post back to the server at least once.

 
New Post 5/9/2008 9:07 AM
User is offline Tigris7
165 posts
9th Ranked


Re: DNN 4.5.3 JavaScript Issue I Think 

Hmmm... this morning the logout button now works. The calendar however still behaves the same way.

 
New Post 5/9/2008 9:36 AM
User is offline Scott Stokes
108 posts
www.adverageous.com
9th Ranked


Re: DNN 4.5.3 JavaScript Issue I Think 

This is code used in my filemanager for downloading.  It's modified from DNN core filedownload, which was modified from the DNN 2.x version of my filemanager before the re-write.  I know I tried several other methods for sending the file to the client, and this so far seems to work best.

Dim objResponse As HttpResponse = HttpContext.Current.Response
objResponse.ClearContent()
objResponse.ClearHeaders()
objResponse.AppendHeader("content-disposition", "attachment; filename=""" + finfo.Name + """")
objResponse.AppendHeader("Content-Length", finfo.Length.ToString())
objResponse.ContentType = strGetContentType(finfo.Extension)

Dim fileStream As Stream = Nothing
fileStream = New FileStream(finfo.FullName, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)

Dim objStream As IO.Stream = fileStream
Try
 WriteStream(objResponse, objStream)
Catch ex As Exception

  objResponse.Write("Error : " & ex.Message)

Finally
 If IsNothing(objStream) = False Then
        ' Close the file.
         objStream.Close()
         End If
End Try

 objResponse.Flush()
        objResponse.End()


 

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Configure It! (...  DNN 4.5.3 JavaScript Issue I Think
 


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.

 


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
DNN Photo Gallery
DNN Photo Gallery is a truly unique photo management module released January 1st 2006. With DNN Photo Gallery you can REALLY integrate images into your existing portal and make them look like they were designed for your site.
DNN Photo Gallery

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