473,386 Members | 1,835 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,386 software developers and data experts.

Schedule a CallBack , I think .

3
Please brace yourselves as im pretty new to C# & .NET & Java Script. Im not sure this is under the exactly right topic.

I want to periodically check a mysql database for changes. I want to do it asynchronously. Im using C# & Java Script on IIS.

The interface is in html & javascript.

How can I get the client to every 30 seconds send a call back to the server to update the needed details. I am not sure if this is more on the javascript side or on the back end.

I realize that im gonna have to implement The "interrupt" In java script. Another thing is that i dont want it to interfere with the operations that the user might be doing.
Jan 11 '07 #1
4 1817
b1randon
171 Expert 100+
Please brace yourselves as im pretty new to C# & .NET & Java Script. Im not sure this is under the exactly right topic.

I want to periodically check a mysql database for changes. I want to do it asynchronously. Im using C# & Java Script on IIS.

The interface is in html & javascript.

How can I get the client to every 30 seconds send a call back to the server to update the needed details. I am not sure if this is more on the javascript side or on the back end.

I realize that im gonna have to implement The "interrupt" In java script. Another thing is that i dont want it to interfere with the operations that the user might be doing.
You'll need to use AJAX to do this. Ajax includes using an XMLRequest from your javascript as well as sending a response in XML format from the server. Your JS will then parse the response. My guess is that you'll want to do this in conjunction with Window.setInterval() so that it happens every 30 seconds. Google yourself a few tutorials (I don't use C# so I don't have any for you) and get something crude going. I'll be happy to help debug.
Jan 11 '07 #2
AricC
1,892 Expert 1GB
You can also refresh your pages with this meta tag:
Expand|Select|Wrap|Line Numbers
  1. <meta http-equiv="refresh" content="2;url=http://google.com">
Jan 11 '07 #3
beam
3
Thanks . I used a <iframe> that i made invisible .

Expand|Select|Wrap|Line Numbers
  1.   <iframe visible="false" runat="server" id="Reloadstuff"> </iframe>
and some java script for the call back .

Expand|Select|Wrap|Line Numbers
  1.  
  2. function reLoad() 
  3.   frm=document.getElementById("Reloadstuff")
  4.   setTimeout("reLoad()",100000)// call reLoad every 20 seconds. 
  5.   Reload()
  6.  }
  7.  
which is called with an on page load event.




So the page refreshes now. BUT i have another added problem ... Im already using async callbacks.

But on the c# side there seems to be a bottleneck as it doesnt seem to be possible to declare RaiseCallbackEvent twice (overload it ).

The problem is that the call back from eg clicking is ignored when the one that is executed periodically goes through. Should i be creating Threads for it ? I would have thought that it would have automatically done that for me.
Jan 11 '07 #4
b1randon
171 Expert 100+
Thanks . I used a <iframe> that i made invisible .

Expand|Select|Wrap|Line Numbers
  1.   <iframe visible="false" runat="server" id="Reloadstuff"> </iframe>
and some java script for the call back .

Expand|Select|Wrap|Line Numbers
  1.  
  2. function reLoad() 
  3.   frm=document.getElementById("Reloadstuff")
  4.   setTimeout("reLoad()",100000)// call reLoad every 20 seconds. 
  5.   Reload()
  6.  }
  7.  
which is called with an on page load event.




So the page refreshes now. BUT i have another added problem ... Im already using async callbacks.

But on the c# side there seems to be a bottleneck as it doesnt seem to be possible to declare RaiseCallbackEvent twice (overload it ).

The problem is that the call back from eg clicking is ignored when the one that is executed periodically goes through. Should i be creating Threads for it ? I would have thought that it would have automatically done that for me.
You're way into the C# world now. That's got nothing to do with javascript. You probably won't get an answer in this forum.
Jan 12 '07 #5

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

Similar topics

3
by: Tomaz Rotovnik | last post by:
Hi I created very simple dll (vc++) which has three functions (start, stop and initialization). it starts capturing sound from soundblaster and when the buffer is filled with the data, dll calls...
1
by: Mohamed Fysal | last post by:
I have written a Regular DLL with many Export Functions and one CALLBACK fun ction . The callback function declared in the .cpp file of the Regular DLL is as fol lows: typedef BOOL...
15
by: Felix Kater | last post by:
Hi, in a given library I register callback functions with this function: bool set_callback(int index, int (*callback_function)(long)); I need the callback function to also pass the index...
3
by: Jim | last post by:
I have a windows application that is accessing unmanaged code and providing a callback function that will create events at unknown time spans. When the EventHandler (callback function) fires it...
2
by: MR | last post by:
help! I have an unmanaged DLL that I do not have the source code, so i can't recompile or make changes. the DLL requires a callback function. I would like to implement the callback method in a...
13
by: Wilfried Mestdagh | last post by:
Hi, I have an application using a DLL and callbacks. It generate random the error "A callback was made on a garbage collected delegate". I found some articles that the pointer to the delegate...
7
by: hgirma | last post by:
Hello Gurus, Is it possible to schedule a task to run an application deployed using ClickOnce? The executable changes location with each update.. and if i were to run the executable directly,...
6
by: smmk25 | last post by:
Before I state the problem, I just want to let the readers know, I am knew to C++\CLI and interop so please forgive any newbie questions. I have a huge C library which I want to be able to use in...
40
by: Angus | last post by:
Hello I am writing a library which will write data to a user defined callback function. The function the user of my library will supply is: int (*callbackfunction)(const char*); In my...
0
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.