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.0Passing Silverlight value field value to newly opened .aspx brower pagePassing Silverlight value field value to newly opened .aspx brower page
Previous
 
Next
New Post
12/30/2008 9:50 PM
 

I am upgrading a DNN Ajax datagrid page to a Silverlight2 datagrid application within DNN 4.8.4.  The DNN site is running on my local XP SP2 PC under /localhost.



I am storing documents ( .txt, pdf, xls, doc ) files in a SqlServer 2005 db in an image field.  I read the Sql documents table and display the document description and documentID (primary key) in a Silverlight datagrid.  The user selects a grid row ( docID ) and pushes a button.



1)  Silverlight app opens a new browser - DNN displayDoc.aspx page



                Uri uri = new Uri("http://localhost/myDNN/DesktopModules/Docs/displayDoc.aspx");


                HtmlWindow window = HtmlPage.Window;


                window.Navigate(uri, "_blank");



2) The displayDoc code behind page "retrieves" the "docID" key, reads the document from the database into a byte array and displays in the newly opened browser via Response.BinaryWrite.




My orignal DNN .aspx module used Session variable to hold the docID.



I have not been able to get docID data field from Silverlight to a newly open browser ASPX page.  I tried 2 methods:



1) The SilverLight app called a DNN Webservice.  The Webservice then stored the value:  Session(DocKey) = docID.  This does not work because the Webservice call is asynchronous i.e the new ASPX browser page may get a stale Session(DocKey) value  ( the async webservice has not completed the Session write).  I put a 2 second SLEEP after the call to the Webservice and before opening the new browser window but this did not work.



2) Isolated storage.



Dim isoFile As IsolatedStorageFile = IsolatedStorageFile.GetMachineStoreForApplication()



This was the only property that was common between the page.xaml.vb and App_Code\webserviceSessionFunction.vb.   But I get this error:



" GetUserStoreForApplication Unable to determine application identity of the caller."



Googling indicates this only works for ClickOnce apps.  I don't know how this relates to my DNN site.




Thanks for any help.

 

 
New Post
12/31/2008 11:16 AM
 

I think this can be easy if you put the functionality you need in the Silverlight Application.

Meaning, if your desire is to have the person chose an image and then something happens (for example it will delete the image from the database), put that entire functionality into the Silverlight Application. Do not try to pass the event back to the DNN site and have the .ascx page actually respond to the event.

This way all you will need to do is pass the current user to the Silverlight application. This example shows you how to do that.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
12/31/2008 12:16 PM
 

Michael,

The base functionality I need is to retrieve a document (Excel, Word, PDF ... ) from a database and display.  When the document is retrieved, the diplaying page should function like the base document.  For example,  if opening an Excel document, the page would have full Excel functionality.  That is how my current implementation works when the Response.BinaryWrite streams the databased byte data to the newly opened window.

Thanks to your excellent tutorials, I have already implemented Webservices within DNN.

How do I display a functioning Excel or Word document in a Silverlight page if I use WebServices to retrieve the byte stream from the database?

 

 
New Post
12/31/2008 12:40 PM
 

eqx eqx wrote
 

How do I display a functioning Excel or Word document in a Silverlight page if I use WebServices to retrieve the byte stream from the database?

Hmm I have not seen that yet in Silverlight but perhaps you can find something with Google.

However, my suggested design pattern will still work once you find a Silverlight control that will display the document. They would open the document and save it back to the server using web services. The DNN .ascx page should not need to be updated once it launches the Silverlight control.



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
12/31/2008 2:40 PM
 

Michael,

I have not found an Excel or Word Silverlight display control.

I did "solve" this by breaking up the program logic into 2 distinct functions.  This seems to get over the non-determanistic webservice async issue.

1) When a datagrid row is selected, I call the Webservice to set the Session["docID"] variable.

2) The user must click a "Display" button to open the new browser page.  The code behind reads the Session["docID"] variable set in step #1.  The correct document is displayed.

 

There is some wasted webservice calls (step 1), if the use clicks to different grid rows before finally clicking the display button (step 2 ).

 

If there are other ideas and implementations, please post.

 

Thanks

 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Passing Silverlight value field value to newly opened .aspx brower pagePassing Silverlight value field value to newly opened .aspx brower page


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