I have an ASP.NET (C#) web application has some forms to generate reports. When the user submits some form, a PDF report is generated on PostBack and sent to the Reponse stream as a file attachment.
The duration of the report generation may vary, so when the user hits submit, I show a modal infinite-progress-dialog to let them know that their report is being generated and to keep them from pushing any other buttons.
This is all working nicely, except that I don't know when to hide the dialog. Since the response is a file download, my page is never refreshed or notified when the servicer-side report generation is finished.
Does anyone know ho to solve this?
(As a side note, I am not interested at all in any progress tracking of generation and/or download. I just want to know when to hide my "Work in progress..." dialog.)
Thank you for any advice,
Chris
Related
I have a grid view and an edit button in the grid view. On edit button click I am opening a new aspx page that has text fields for input the data. When a user copies the URL of the gridview and opens it in a new tab of any browser then click on the edit button for two different records. If the user changes anything in the first tab and submits it. It changes the info for the record on the second tab. It is happening because I am passing userid in session to the form aspx page and session got updated when user opens the second record in the new tab.
Are there only two ways to passing data to aspx page?
using session
using a query string
I don't want to use the query string.
Please help thank you.
You are writing a ASP.Net application, so at the end of the day there is only that much you can do. You can request some things off the browser, but if he actually does it is entirely up to it.
You can make it unlikely to happen by accident, using the HTML Links target property. This requests the browser to re-use any alread open tabs for this record. But that will not prevent a dedicated person from still opening 2 copies.
A pretty simple way to avoid race conditions in general, is the SQL rowversion column. You retreive the rowversion with the rest. You keep it along in a hidden formular field (that is what they are there for). When writing the update, check if it still matches before the write. If yes, you update. If not, somebody has modified the record since then and you reject the update. Can be the same user in another tab, can be another user at the end of the world. Could be that this tab was opened a year ago, surviving on sleep mode. It does not mater - any change trips this protection.
I am at a loss as to how this is best handled in asp.net
I have a webpage with a lot of panels, and tables that is populated with data from mysql request. Now this data might change depending on an input. All the data are buttons that will open a modal windows displaying data.
My issue is that when I press the button the modal opens, but all the tables are reset to the standard "sql data" and the panels collapses. I basiclly want to be able to post back to the exact spot the user was earlier, including where on the page he had scrolled.
I get that the created html istanse is destroyed as soon as the person moved to the modal but how can i store the current exact state of the webpage so when the user goes back he is met with the exact "copy" he left. I've looked into viewstate and state management, and also to check for postback but still havent been able to solve it.
Is there any good tutorial covering this topic?
I've looked into this: Persisiting the state of a webpage
But thats based on ASP2.0 (im at 4.5) and dated 2006. Would this approach still be my best option or is this fixed in a better way on newer ASP.NET version?
I'm using Active Reports 6 and display the report in our application in the Viewer control (not printed). I need a way to determine the current page the user is showing, and I also need a way to restore the Viewer to a specific page. I need this because when data is added to the report, the Viewer automatically resets to page 1. I've searched high and low and cannot find a way to do either. Can this be done in Active Reports and if so can anyone tell me how to do it? Thanks!
You may make use of the 'CurrentPage' property of the ReportViewer that gets or sets the number of the current document page displayed in the viewer.
Regards,
Mohita
i am doing practice in crystal reports in asp.net web application. I am finding two problems, first one is each time i run my app crystal reports ask for password to login the database and also do not update the dynamic fields. the second one is i want to open crystal report on click of button whenever i click on button object of crystal report creates and then it calls its page_load(this,null) in which i am giving parameter this and null but the page is not going to be open.
please help me and sorry for poor english
thanks
You can try this. May be help to you...
Here's a link!
First You can try using datasets for avoiding logon credentials to be provided everytime crystal report is to be viewed. If you are using dataset make sure your dataset is preserved between each postback by storing the "session" dataset.
Second pass logon credentials programatically for the database being used. Passing logon credentials is explained in lot of forums.
Third, if you are using Submit button for viewing the report, make sure you effect a full postback on submit button click. You will find that all pages in the report will work perfectly fine.
Note: Use Trigger with Update Panel to Effect the Full Post Back (The Control ID of the trigger should be the ID of the button).
I have an .aspx page that connects to a remote application. I want to add a progress bar to the web page to show the client, the current progress of the operation. There are many text fields in the page and I do want the content to be displayed to the user all the time. (I do not want the page to be refreshed every time the progress bar updates). Is there any way to only update the progress bar without refreshing the whole page, using C# or JavaScript?
p.s. I am kind of new to JavaScript, so some kind of an explanation is greatly appreciated.
(forgive me if the English used is wrong)
Sounds like you need to make use of the AJAX extensions that are enabled in .NET 3.5 by default.
You'll simply put a scriptmanager anywhere on the page, wrap the content that you want to update in an UpdatePanel (which will enable partial page updates) and use an UpdateProgress to feedback the progress to the user.
Have a look here for more.