Best Practice for Multiple Pages and Multiple Users

Discussions about DocuVieware integration in GdPicture.NET.
Post Reply
random1
Posts: 10
Joined: Wed Jul 07, 2021 3:55 pm

Best Practice for Multiple Pages and Multiple Users

Post by random1 » Fri Jan 28, 2022 9:29 pm

I'm trying to work on an app where multiple pages will load TIFF files via the docuvieware control. This is a multiple user application where users can load different images on the same page based on whatever record they are viewing.

For example:
user1->page1->tiff1

then

user1->Page1->tiff2

Then at the same time another user hits the same pages loading different images:
user1->Page1->tiff3

then

user1->page2->tiff4

I find the documentation into how the session data is stored a little sparse, so I figured I would ask. I did notice that if I load an image, go to a different page and then go back to the page the docuvieware control will reload the image in session.

To get around this I call DocViewer.Close() on the page load (provided it isn't a postback).

Is this the best approach to managing sessions accross the entire user base ??

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Best Practice for Multiple Pages and Multiple Users

Post by Fabio » Thu Feb 10, 2022 4:36 pm

Hello,

I'm struggling to understand your use case.
When you say "page", does it mean a web page or a document page where you dynamically set some TIFF images?

In any case, if you want to let your user displays different documents at the same time on the same machine, may the best approach will be to generate a new DocuVieware instance since DocuVieware manages a session with an active file.

The Close() method, will unload the viewer's loaded file. Using it will not allow you to manage 2 documents at the same time.

Please, elaborate on your question if I didn't understand it well.

Best regards,
Fabio

random1
Posts: 10
Joined: Wed Jul 07, 2021 3:55 pm

Re: Best Practice for Multiple Pages and Multiple Users

Post by random1 » Thu Feb 10, 2022 9:14 pm

Thanks Fabio.

This was the scenario: I have a page that displays a gridview with a row for every document we need to display. The Docuvieware control doesn't load any file until the user clicks an item in the grid. When they click a grid row, we query the DB and load it into the Docuvieware control via LoadFromStream. This all works as expected, however, when we navigate away from that page and then back to it later on, the Docuvieware control loads the image without us clicking the grid. It seems to have stored the previously loaded image into session and loads it by default.

So:
1) User clicks on imageView.asp, chooses a record from the gridview which refreshes the docuvieware control on that page.
2) User then navigates away from that page to perform other system functions.
3) User then navigates back to imageView.asp and the page automatically loads the image from step 1.

I've found that the DocViewer.Close() method prevents this scenario. I'm just wondering if the session is user specific OR global/static across the control. I want to avoid situations where Docuvieware loads an image with an explicit selection from the gridview.

User avatar
Fabio
Posts: 173
Joined: Thu Aug 27, 2020 9:57 am

Re: Best Practice for Multiple Pages and Multiple Users

Post by Fabio » Fri Feb 11, 2022 6:05 pm

Hello there,

I think the right method you're looking for is this one: https://www.docuvieware.com/guides/aspn ... ssion.html

It will destroy all the objects handled by the specified Docuvieware session, so the document will not be loaded back to the viewer.

Best regards,
Fabio

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest