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.0Problems with clicking button inside IFrame Problems with clicking button inside IFrame
Previous
 
Next
New Post
8/9/2006 10:02 AM
 
I built an app in IronSpeed Designer that works fine when I am just looking at it using localhost.  It's a table that has columns, one of which is a button.  When you click on the button, it looks in the db for a file that you have uploaded, and downloads the file for viewing.

Everything is working fine when I am on the machine that is hosting it and I look at it using localhost.

It even looks fine when I have it inside an IFrame.  I can do all of the functionality except the downloading.  The event code is in the clicked event of the button.  As I said, it works fine when I am outside the IFrame.

Any ideas?  This is pretty much it as far as what I have to do before I deploy this thing.


 
public override void Initial_Click(Object sender, EventArgs args) 
{
try
{
DbUtils.StartTransaction();

// Get the record.
LegalContractSubmitRecord rec;
rec = this.GetRecord();
if (!(rec == null))
{
this.Page.Response.Write("Inside rec !=null");
// Get the name of the attachment.
string filename = rec.initialFileName;
byte[] contents = rec.initialFile;

// Store the contents of attachment temporarily in a file.
// Delete the temporary file if it exists already.

if (System.IO.File.Exists(filename))
{
System.IO.File.Delete(filename);
}

// Create the temporary file and store contents.
System.IO.FileStream fs;
fs = new System.IO.FileStream(filename, System.IO.FileMode.CreateNew);
System.IO.BinaryWriter bw;
bw = new System.IO.BinaryWriter(fs);
bw.Write(contents);
bw.Flush();
bw.Close();
fs.Close();

// Set up download parameters.
this.Page.Response.ContentType = "APPLICATION/OCTET-STREAM";
string disHeader;
disHeader = "Attachment; Filename=\"" + filename + "\"";
this.Page.Response.AppendHeader("Content-Disposition", disHeader);
System.IO.FileInfo fileToDownload;
fileToDownload = new System.IO.FileInfo(filename);
this.Page.Response.Flush();
this.Page.Response.WriteFile(fileToDownload.FullName);
this.Page.Response.End();
}
}
catch (Exception ex)
{
DbUtils.RollBackTransaction();

// Report the error message to the user.
BaseClasses.Utils.MiscUtils.RegisterJScriptAlert(this, "UNIQUE_SCRIPTKEY", "There is no file loaded. Edit the record and upload a file.");
}
finally
{
DbUtils.EndTransaction();
}
}
 
 
New Post
8/14/2006 11:17 AM
 
turns out the directory it was temporarily writing to was not allowing access to the account.  The tech followed the log and found the dir, changed the permissions for the user and it worked like a charm.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Problems with clicking button inside IFrame Problems with clicking button inside IFrame


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