Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Visual Alert when a new record is added in the dataset

Status
Not open for further replies.

phytos

Technical User
Oct 20, 2002
15
0
0
CY
i used macromedia 2004 mx, asp.net and access database to make a simple web application to keep track of the phone call messages recieved in my company. In the main page i have a dataset to display all records of the call that have not been acknowledged yet, the page refreshes everyone 1 min to display any new records added. I was wondering if there is a way to make a visual alert like a popup message or a window to open up to inform you that a new record was added instead looking all the time at the page to see if a new record pops up.
My programming knowledge is minimal
Thanks in advance.
 
You have quite a few options here. Here's a couple of simple ones...

1) When the page refreshes you can see if any new items have been added and if so you could maybe set the colour of a label on your page to a different colour.

2) You could have a javascript function on your page (to load a pop up box) and when the page refreshes, check if a new entry has been added. If it has could could add the javascript function to the body onload event e.g.

Code:
body.Attributes.Add("onload", "MyPopUpFunction()")


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
can you give me an example in how to make it
cause im so confused
 
Sure...

First of all you would create a javascript function that could pop up a new window. e.g.

Code:
<script language="javascript">
<!-- begin

function popup(Site)
{
window.open(Site,'MyPopUp','menubar=yes,toolbar=no,statusbar=no,location=no,scrollbars=yes,resizable=yes,width=600,height=400')
}

// end -->
</script>

Then in your page load you would add the onload event if a particular criteria was met and show a pop up page. e.g.

Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

Dim blnNewRecord As Boolean = True
Dim strID as Integer = 1

' If the user has come from the Add Page pop up the printable window
If blnNewRecord = True Then
     body.Attributes.Add("onload", "popup(MyPopUpPage.aspx?ID=" & strID & "')")
End If

End Sub

In the above example I have used a boolean value named blnNewRecord to indicate that a new record has been added. Obviously you would have to query your db to see if this is the case and set the boolena value accordingly.

Then you could just create a MyPopUpPage.aspx page that would show details of the new record that has been added (by using the ID querystring that is passed to it).

Hope this helps


----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top