nhammouda
 New Poster Posts:13
 | | 05/12/2010 1:53 AM |
| Dear All,
I have a live streaming channel display in the site, and i wanted to announce live broadcast to the users by refreshing the page when live broadcast starts. So i made a module that has only a text saying live broadcast is here, and in that module (which is hidden unless at time of live streaming) i added a javascript that refreshes the page using this code:
setTimeout("location.reload(true);",10000000);
just to be able to refresh the page once, till the live broadcast finishes then I make the module hidden again so i guarantee with the very big time value that it is only refreshed once.
However, nothing happens at all, if I am opening the site already I have to press F5 to get that text and see the module visible..
My question is, how do I push the page through the open sites in browsers already so that users know there is broadcast now without them pressing F5 every few seconds please?
Thanks a lot | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 2:29 PM |
| | I believe I answered this for you on the DotNetNuke.com forums. if you still need assistance let me know. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 3:11 PM |
| Hello Mitchel, Thanks for your answer..but i sitll can't get it! I searched for Javascript Server PUSH code...and i found something called Comet ..but it talked mostly about PHP...and it was too complicated i coudlnt understand it...can you provide me with a sample plz? anythign might help... I cna't understand why is this so complicated!! i thought it was just a screen refresh! but when i implemented it i found out it refreshes the current user screen only, and it doesnt refresh all the open browsers screens... Thanks alot... | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 3:15 PM |
| | There is an Ajax timer control that is available from ASP.NET that will get you what you want. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 3:17 PM |
| but i don't know how to add ASP.Net code to an html module?? i thought i only add javascript code?? i can tsearch for that control, but where can i read about adding asp.net to DNN html module plz? Thanks | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 3:31 PM |
| Oh, i thought that this was a custom module type situation.
What you are trying to do is most likely going to require some custom development, or some really fancy toggling if you don't want to have a custom module for it. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 3:36 PM |
| Well, do you know someoen to make a custom development for me plz? i asked some good companies and they told me it takes 10 hours with a big rate like 75$ an hour!! juhst for somethign simple like that!! " border=0> Do you knkow someone who can take like 100 $ max plz to do it for me? Thanks. | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 3:38 PM |
| I do custom development work, but you are looking at 5-10 hours as we would need to clarify exactly what you are trying to do with everything. And I charge $110/hour for development services.
I doubt you are going to find someone to do it for $100 total.
You could try a javascript function that reloads the page every 10 seconds and reset the location to the current location. It isn't elegant, it will hit your server with a lot more traffic, and will NOT be as good for your users, but it will fit the budget.... | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 3:43 PM |
| But thats what i did! i wrote this code setTimeout("location.reload(true);",10000000); and when the module gets activated (the module is hidden, and i only make it visible when there is live braodcast) it refreshes the open page. However, it doesnt refresh the page for the other users with other browsers open. How can that be? i don't get it?? Thank you so much for your support i really appreciate it... Nehal. | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 3:53 PM |
| That timeout is not going to get hit, you are setting it to something like two hours.
Your timeout is going to have to be something like every 30 seconds, minute or something like that.
The users browser is going to have to do the refresh, so this code must be set to every users machine, but with a timeout value that makes sense.
30000 for example which is 30 seconds. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 3:59 PM |
| you mean this code is ok but i should just make it less than two hours? But the problem is i don't want to screen to refresh more than once or twice only! not every few seconds...and i searched for a code that refreshes the screen once only and i got this one, which refreshed the current user browser only and not other open browsers, you see i opened the site with another browser, and waited for any refresh to happen so that the module (with a sentence saying WE ARE ONLINE NOW ) is appearing, but nothing! [script removed]
// Published at: scripts.tropicalpcsolutions.com
var reloaded = false;
var loc=""+document.location;
loc = loc.indexOf("?reloaded=")!=-1?loc.substring(loc.indexOf("?reloaded=")+10,loc.length):"";
loc = loc.indexOf("&")!=-1?loc.substring(0,loc.indexOf("&")):loc;
reloaded = loc!=""?(loc=="true"):reloaded;
function reloadOnceOnly() {
if (!reloaded)
window.location.replace(window.location+"?reloaded=true");
}
reloadOnceOnly(); //You can call this via the body tag if desired
[script removed]
| | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 4:07 PM |
| Ok, there is no way then to get what you want without a custom solution.
THE ONLY way to get it via javascript is to refresh the page every X seconds so it can poll the system?
Otherwise you are going to need some code that can do it behind the scenes. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 4:11 PM |
| Ok so to make sur ei understannd you correctly, if i use this line: setTimeout("location.reload(true);",60000); this will poll the server FOR ALL USERS OPEN BROWSERS every one minute...right? and not only on the open user browser right? Thank you so much for your help i truely appreciate reaching a conclusion from an expert like yourself Sir. Best Regards Nehal. | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/13/2010 4:16 PM |
| | Any browser window that is open, this SHOULD cause it to refresh. IF they have javascript enabled. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/13/2010 4:43 PM |
| Hello Again Micheal, I hope i am not bothering you again " border=0> but i found this very interesting polling code which is supposed to poll the server only if it changed so i am assuming then it wont refresh except once?? http://ajaxpatterns.org/Periodic_Refresh this is the part i am internested in: this.timerID = setInterval(function () { thisObj.get(true); }, interval);
get() performs a straightforward query of the server: this.httpGetObj.open('POST', this.url, true);
this.httpGetObj.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
var thisObj = this;
this.httpGetObj.onreadystatechange = function () { thisObj.handleGet(system); };
this.httpGetObj.send(param);
Do you think thisi will work? i don't know how to try it! i mean, how do i use the timerID?? or should i ignore the timerID and just use setInterval(function () { thisObj.get(true); }, interval); and i set interval to say 30 seconds? hoping it won't refresh except once?
| | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/14/2010 8:24 AM |
| | I have no clue, I am not familiar with how that code works. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|
nhammouda
 New Poster Posts:13
 | | 05/14/2010 8:33 AM |
| Its ok, i discarded it...I tried the setTimeout("location.reload(true);",30000); to refresh the page every 30 seconds. But consider this scenario: 1-user A has his browser open 2-I make my hidden module visible (the one that has the above setTimtout code as well as text saying WE ARE ON AIR NOW) 3-Nothing happenes to the user A screen at all EXCEPT AFTER HE PRESSES F5 And that is not what i want, i want the user who has his browser already open to get the WE ARE ON AIR notification without having to press F5. So, any clue how should i do that? os that's what you suggest to have it custom made? Do you knwo of any module to be purchased from snowcovered that does that even Micheal? Thank you so much. Nehal | | | |
|
Mitchel Sellers Site Admin/Owner
 Guru Posts:6089
 | | 05/14/2010 8:39 AM |
| Ok, to refresh the page the javascript setTimeout MUST be rendered to their page
What you are going to have to do is have a module visible that contains that script
Then when you "go live" make that one not visible and the "we are on air now" one visible. | | -Mitchel Sellers Microsoft C# MVP, MCITP Director of Development IowaComputerGurus Inc.

For shared hosting I recommend PowerDNN
This site is hosted on a Dedicated Server from PowerDNN.com
To get Guaranteed DNN Support check out our affordable DNN Technical Support Programs | |
|