Click here to Skip to main content
15,886,873 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to open msn messenger..... Pin
Christian Graus4-Jun-09 11:48
protectorChristian Graus4-Jun-09 11:48 
AnswerRe: how to open msn messenger..... Pin
RichardGrimmer5-Jun-09 0:53
RichardGrimmer5-Jun-09 0:53 
Questionset binary image in Image web control. Pin
andiyuniar4-Jun-09 0:26
andiyuniar4-Jun-09 0:26 
AnswerRe: set binary image in Image web control. Pin
Ryomin4-Jun-09 5:55
professionalRyomin4-Jun-09 5:55 
GeneralRe: set binary image in Image web control. Pin
andiyuniar4-Jun-09 16:18
andiyuniar4-Jun-09 16:18 
QuestionJQuery AJax Problem Pin
Jagz W3-Jun-09 23:38
professionalJagz W3-Jun-09 23:38 
AnswerRe: JQuery AJax Problem Pin
Christian Graus3-Jun-09 23:53
protectorChristian Graus3-Jun-09 23:53 
Questionusing timer to refresh gridview Pin
Arif Liminto3-Jun-09 22:53
professionalArif Liminto3-Jun-09 22:53 
Hi guys,

I am still newbie in asp.net

I want to refresh gridview every 30 seconds using timer
and I have got the problem with calling non-static function to databind the gridview.
here is example of my code

<br />
Timer AlertTimer = null;<br />
 protected void Page_Load(object sender, EventArgs e)<br />
 {<br />
   //load to gridviewAlarm for the first time<br />
   Alert a = new Alert();<br />
   DataTable dt = new DataTable();<br />
   a.LoadAlarmFromDB(ref dt);<br />
   gridviewAlarm.DataSource = dt;<br />
   gridviewAlarm.DataBind();<br />
<br />
   AlertTimer = new Timer();<br />
   AlertTimer.Start();<br />
   AlertTimer.Elapsed += new ElapsedEventHandler(AlertTimer_Elapsed);<br />
   AlertTimer.Interval = 30000;<br />
<br />
}<br />
    public static void AlertTimer_Elapsed(object source, ElapsedEventArgs e)<br />
    {<br />
           Alert a = new Alert();<br />
           DataTable dt= new DataTable();<br />
           a.LoadAlarm(ref dt);<br />
<br />
           <br />
           //in here how to call bindGridView()<br />
           // i have tried those below<br />
           //but it doesnt work<br />
          <br />
<br />
           //Test_MasterPage M = new Test_MasterPage();<br />
           //M.bindGridView();<br />
<br />
    }<br />
    public void bindGridView()<br />
    {<br />
        gridviewAlarm.DataSource = "";<br />
        gridviewAlarm.DataBind();<br />
        gridviewAlarm.DataSource = m_AlarmDT;<br />
        gridviewAlarm.DataBind();<br />
    }<br />


how do i call non static function in static function?
thanks so much for the help

Regards,

Arif
AnswerRe: using timer to refresh gridview Pin
K03063-Jun-09 23:05
K03063-Jun-09 23:05 
GeneralRe: using timer to refresh gridview Pin
Christian Graus3-Jun-09 23:27
protectorChristian Graus3-Jun-09 23:27 
AnswerRe: using timer to refresh gridview Pin
Christian Graus3-Jun-09 23:28
protectorChristian Graus3-Jun-09 23:28 
AnswerRe: using timer to refresh gridview Pin
Brian W King4-Jun-09 2:20
Brian W King4-Jun-09 2:20 
QuestionCheck Box as Toggle Pin
CodingLover3-Jun-09 20:54
CodingLover3-Jun-09 20:54 
AnswerRe: Check Box as Toggle Pin
Christian Graus3-Jun-09 21:00
protectorChristian Graus3-Jun-09 21:00 
AnswerRe: Check Box as Toggle Pin
Brian W King4-Jun-09 2:33
Brian W King4-Jun-09 2:33 
Questionjavascript for disable back button Pin
Kissy163-Jun-09 20:53
Kissy163-Jun-09 20:53 
AnswerRe: javascript for disable back button Pin
Christian Graus3-Jun-09 21:00
protectorChristian Graus3-Jun-09 21:00 
AnswerRe: javascript for disable back button Pin
Jay Royall3-Jun-09 22:33
Jay Royall3-Jun-09 22:33 
GeneralRe: javascript for disable back button Pin
Kissy163-Jun-09 23:00
Kissy163-Jun-09 23:00 
GeneralRe: javascript for disable back button Pin
Jay Royall3-Jun-09 23:28
Jay Royall3-Jun-09 23:28 
GeneralRe: javascript for disable back button Pin
Christian Graus3-Jun-09 23:36
protectorChristian Graus3-Jun-09 23:36 
GeneralRe: javascript for disable back button Pin
Kissy164-Jun-09 0:10
Kissy164-Jun-09 0:10 
AnswerRe: javascript for disable back button Pin
Brian W King4-Jun-09 2:40
Brian W King4-Jun-09 2:40 
AnswerRe: javascript for disable back button Pin
RichardGrimmer5-Jun-09 0:58
RichardGrimmer5-Jun-09 0:58 
QuestionMicrosoft Certification Professional in ASP.NET Pin
K03063-Jun-09 20:08
K03063-Jun-09 20:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.