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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...BLOB retrieval using DNN and RadGridBLOB retrieval using DNN and RadGrid
Previous
 
Next
New Post
8/3/2011 1:20 PM
 
I'm pretty new to DNN and working with Telerik controls, so I hope someone can help.

In short, I'm a .NET programmer who is currently developing modules for use within DotNetNuke. For the module I'm currently working on, I'm displaying data in a Telerik RadGrid. One of my columns contains a LinkButton which when it's clicked needs to run a function that retrieves a BLOB from my database and opens the pdf file.

I've got this working within a .NET test environment using a GridView. Here's the code for my OnClick event:

public void lnkWebFileName_Click(object sender, EventArgs e) 

   Label lblWebFileNameNew = (Label)((Control)sender).NamingContainer.FindControl 
   ("lblWebFileName"); 
   string webfilename = lblWebFileNameNew.Text.ToString(); 
   BlobRetrieval.WriteDocumentWithStreaming(webfilename); 


I haven't included the code for WriteDocumentWithStreaming because in .NET this works like a charm, so I know my retrieval code works.

Trying to get this to work via my RadGrid, however, is another issue. For testing purposes, I use the following code to make sure I'm getting the webfilename value and then I change the button text:

public void lnkWebFileName_Click(object sender, EventArgs e) 

   Label lblWebFileNameNew = (Label)((Control)sender).NamingContainer.FindControl   
   ("lblWebFileName"); 
   LinkButton lnkBtn = (LinkButton)((Control)sender).NamingContainer.FindControl 
   ("lnkWebFileName"); 
   string webfilename = lblWebFileNameNew.Text.ToString(); 
   lnkBtn.Text = webfilename; 


Works perfectly! The problem is when I add:

BlobRetrieval.WriteDocumentWithStreaming(webfilename); 

to try to display the pdf file, it does nothing. I checked DNN's EventViewer, and the only error message I get is:

System.Exception: Unhandled Error 

Does anybody have any idea what to do to retrieve and display a BLOB via a RadGrid? Do I have to do something special with my existing code, or is there something specific within RadGrid that needs to be done?

I don't know if this is a problem related to DNN or to Telerik.

Someone please help get rid of this headache. Thank you!

MKDnn
 
New Post
8/4/2011 3:46 PM
 
Working with Telerik in DNN is (for the most part) no different in DNN as you have noticed. However, based on the error you have there I can't say what the issue is but I have a couple suggestions to help you track it down:
  • In your BlobRetrieval method:
    • catch the exception, log it to (something like Services.Logging.LogException(exc), similar to ProcessModuleLoadException used in most modules and should be in your loaded ascx.cs file's page load; it can serve as an example). This will catch the exception and put it in the dnn log viewer with better details (in debug module, of course). 
  • If you are using DNN 6, you also have some log4net logging going on, which writes to Portals/_default/Logs that may help you (before and after the above change)

Chris Paterra

Get direct answers to your questions in the Community Exchange.
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...BLOB retrieval using DNN and RadGridBLOB retrieval using DNN and RadGrid


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