473,383 Members | 1,840 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

ASP crosspage notifications

I am not sure what exactly it is that i am looking for or what it is called, but i can explain the situation i have. I am hoping someone can suggest some possible solutions.

I have a multi-page application that does several different functions. Some of these functions include pulling single reports from an SQL server, tracking user data entry, and creating multiple .pdf and .xls files at the same time. The last of those functions is that main source of my situation.

When a user sends the request to have the files to be created(80-150 files) they need to be able to leave the page after it has been submitted. They are currently able to leave the page and the job will continue to run but i need a way to provide notification to the user that the job has received an error or has completed.

The application uses windows authentication and also uses a master page. A users login status is displayed on the page. I was thinking of something that would allow a user to mouse over their login status and have a bubble popup or box slide out that displayed any current jobs and their progress. Also when the job finished it would somehow provide a notification message somewhere on the screen to the user no matter what page they are on.

Thank you for any help or suggestions.
May 7 '08 #1
6 1048
danp129
323 Expert 256MB
I would have the page that creates the files log them to a database record, assigning it to that user. Create a javascript that's included on all pages do an AJAX query to another page that queries the database and returns any completed jobs that user has not looked at yet. If there are jobs returned, have the javascript do a DHTML popup or write some html into a previously hidden DIV near the users login status, then unhide the DIV. You could set the javascript to check the job status every 30 seconds so people that are not surfing will see the job is done instead of having to refresh or browse to another page to get a status update.
May 7 '08 #2
That sounds pretty much exactly what i am looking for, but do you have or know of anywhere for some code samples for the dhtml popup and possibly the ajax calls.
May 7 '08 #3
danp129
323 Expert 256MB
Javascript / DHTML / Ajax Forum would be a good start for those questions. You may want to browse Javascript / DHTML / Ajax Articles. Or see if you can do what you need just by reading Ajax Example.

For DHTML popups look here , be sure to click the various examples in the nav bar.
May 7 '08 #4
DrBunchman
979 Expert 512MB
Moved to .NET forum.

Dr B
May 8 '08 #5
JamieHowarth0
533 Expert 512MB
If you are using SQL Server, then you could be a bit clever and drop your .NET processing code into a SQL stored procedure and enable CLR (Common Language Runtime) integration through SQL Server Configuration Manager. This way, your .NET code inside SQL Server can create PDF/XLS files, and the server can then pick up the responsibility of notifying the user when the files are ready (i.e. stored procedure complete) by using Database Mail.

It'd be something I'd be quite interested in trying at some stage. PM me if you want an extra hand.

medicineworker
May 8 '08 #6
I just thought i'd show what i came up with and see if anyone had any suggestions.

My Javascript file
Expand|Select|Wrap|Line Numbers
  1. var XMLHttpRequestObject
  2.  
  3. function getData()
  4. {
  5. XMLHttpRequestObject = getXmlHttpObject();
  6.  
  7. if (XMLHttpRequestObject==null) {
  8.     alert("Browser does not support HTTP Request");
  9.     return;
  10. }
  11.     var obj = document.getElementById("targetDiv");
  12.     XMLHttpRequestObject.open("GET","http://localhost:49646/getProcesses.aspx");
  13.     XMLHttpRequestObject.onreadystatechange = function()
  14.     {
  15.         if (XMLHttpRequestObject.readyState == 4 &&
  16.           XMLHttpRequestObject.status == 200) {
  17.             obj.innerHTML = XMLHttpRequestObject.responseText;
  18.         }
  19.         if (XMLHttpRequestObject.readyState==4 || XMLHttpRequestObject.readyState=="complete")
  20.         { 
  21.         document.getElementById("targetDiv").innerHTML=XMLHttpRequestObject.responseText;
  22.         } 
  23.     }
  24.  
  25.     XMLHttpRequestObject.send(null);
  26.     setTimeout("getData ()", 5000);
  27. }
  28.  
  29. function getXmlHttpObject()
  30. {
  31. var objXMLHttp=null;
  32. if (window.XMLHttpRequest)
  33. {
  34. objXMLHttp=new XMLHttpRequest();
  35. }
  36. else if (window.ActiveXObject)
  37. {
  38. objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
  39. }
  40. return objXMLHttp
  41. }
.aspx page that is called to retrieve data
Expand|Select|Wrap|Line Numbers
  1. Imports System
  2. Imports System.Data.SqlClient
  3. Imports System.Web.Configuration
  4.  
  5. Partial Public Class getProcesses
  6.     Inherits System.Web.UI.Page
  7.  
  8.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  9.         Dim mConnectionString = WebConfigurationManager.ConnectionStrings("Database_Connection").ToString
  10.         Dim conn As SqlConnection = New SqlConnection(mConnectionString)
  11.         Dim cmd As New SqlCommand("select * from tbl_APP_Processes where status = 'complete' ", conn)
  12.         Try
  13.             conn.Open()
  14.             Dim reader As SqlDataReader = cmd.ExecuteReader()
  15.             Response.Write("<table>")
  16.             Response.Write("<thead><tr><th>User</th><th>Application</th><th>Status</th></tr></thead>")
  17.             While reader.Read()
  18.  
  19.                 Response.Write("<tr><td><b>" & reader.GetString(1) & "</b></td><td>" & reader.GetString(2) & "</b></td><td>" & reader.GetString(3) & "</b></td></tr>")
  20.             End While
  21.             Response.Write("</table>")
  22.         Catch ex As Exception
  23.             Throw ex
  24.         Finally
  25.             cmd = Nothing
  26.             conn.Close()
  27.         End Try
  28.     End Sub
  29.  
  30. End Class
The main .aspx page(it only contains a div called "targetDiv"
Expand|Select|Wrap|Line Numbers
  1. Public Partial Class _Default
  2.     Inherits System.Web.UI.Page
  3.  
  4.     Private Sub _Default_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  5.         Dim str As String
  6.         str = "<script language=javascript> {getData();}</script>"
  7.         Me.Page.RegisterStartupScript("Startup", str)
  8.     End Sub
  9. End Class
May 8 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Dipak Patel | last post by:
Platform: Win2000 SP3, SQL 7.00 - 7.00.1063 I have a SQL-authenticated user with the following permissions: "Process Administrators" server role "db_owner" and "TargetServersRole" for msdb...
0
by: Steve | last post by:
Some of my power users create their own SQL Agent jobs. All well and good. However, I don't wish to give them System Administrator privileges, and when they create their jobs, the check box to...
0
by: Hutch | last post by:
I am looking for some thoughts on this. I have successfully gotten the HTMLControl to work using C#, and it is displaying HTML and receiving messages nicely. Unfortunately, I am not able to...
0
by: Kevin | last post by:
I am successfully creating and deleting appointments and sending invitations in a C# / ASP.NET / Exchange2000 environment. It works great! But the problem is that no notifications are sent out...
0
by: tofu.captain | last post by:
I have an ASPX page that needs to read in form values (txtbox, dropdownlists, etc) from a custom control that redirects execution by crosspage postback. Here is the how it is being redirected: ...
0
by: GovardhanReddy | last post by:
Hi Can any body help me on window service desktop alerts or notifications. My question is i am working on windows services,I need to generate desktop Notifications using my services.I did...
1
by: Mike Bevins | last post by:
Hello All, I have a web service that handles incoming notifications. 2 notifications can come in at the same time and reference the same item so I need a way to know both of them are there when...
4
by: windypower | last post by:
I'm looking for a way to implement desktop notifications (much like an instant messaging program or a mail notifier) within my Python application, on Windows only (no Gtk/Galago, please). I need no...
5
by: njuneardave | last post by:
I have a full-screen C# app, but windows notifications (the little balloons on the bottom right-hand of the screen) and outlook reminders will pop on top of my app. i want to prevent them from...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.