Click here to Skip to main content
15,883,883 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Merhaba
asp.net sayfalarıma sql tablolarıma akan verileri 1 saniye arayla refresh etmem gerekiyor.
Bu refresh olayını Timer kullanarak yapabiliyorum.

Google Translate:
Hi
I need to refresh the data flowing to my asp.net pages into my sql tables every 1 second.
I can do this refresh using Timer.

<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:timer id="Timer1" runat="server" interval="1000">

Fakat bu şekilde yaptığımda WebBrowser tarafında olay gerçekleşiyor ve aynı anda 30 form çalışacağı için server için sıkıntı yaratıyor.

Bu refresh olayını webbrowser da değilde form içinde nasıl yapabilirim.
Konu hakkında yardımcı olabilir misiniz.
Teşekkürler.

Google Translate:
But when I do this, the event happens on the WebBrowser side and it creates trouble for the server since 30 forms will be running at the same time.

How can I do this refresh in form, not in webbrowser?
Can you help on the subject.
Thank you.


What I have tried:

<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:timer id="Timer1" runat="server" interval="1000">
Posted
Updated 11-Oct-20 11:23am
v2
Comments
Richard Deeming 25-Sep-20 4:34am    
This is an English-language site. Please post questions in English.

Bu İngilizce bir sitedir. Lütfen sorularınızı İngilizce olarak gönderin.
Member 14507998 27-Sep-20 4:30am    
HiI need to refresh the data flowing to my asp.net pages into my sql tables every 1 second.
I can do this refresh using Timer.

<asp:scriptmanager id="ScriptManager1" runat="server">
<asp:timer id="Timer1" runat="server" interval="1000">


But when I do this, the event happens on the WebBrowser side and it creates trouble for the server since 30 forms will be running at the same time.

How can I do this refresh in form, not in webbrowser?
Can you help on the subject.
Thank you.
Member 14192879 7-Oct-20 20:39pm    
you can refresh the form by using asp:AsyncPostBackTrigger in update panel. AsyncPostBackTrigger will trigger the timer and update code will refresh panel content(yo==what you have write in <contenttemplate> ) without refreshing the entire form.
you can try this code:
<asp:timer id="Timer1" runat="server" ontick="Timer1_Tick" interval="1000">

<asp:updatepanel id="UpdatePanel1" runat="server" maintainscrollpositiononpostback="true">
<triggers>
<asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick">

<contenttemplate>
your code


1 solution

you can refresh the form by using asp:AsyncPostBackTrigger in update panel. AsyncPostBackTrigger will trigger the timer and update code will refresh panel content(what you have written in <contenttemplate> ) without refreshing the entire form.
you can try this code:
<asp:timer id="Timer1" runat="server" ontick="Timer1_Tick" interval="1000">

<asp:updatepanel id="UpdatePanel1" runat="server" maintainscrollpositiononpostback="true">
<triggers><asp:asyncpostbacktrigger controlid="Timer1" eventname="Tick">

<contenttemplate>
your code
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900