Click here to Skip to main content
15,895,084 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
As per topic in discussed. I've assigned one Timer1_Tick (AJAx Control) into my web form user control but it is not working right until i've perform "__doPostBack" in client side and it is not be able to perform automatically once the form is loaded.

Code in markup:

ASP.NET
<asp:UpdatePanel ID="TimeSheetUpdate" runat="server" UpdateMode="Conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="TimeSheetTimer"  EventName="Tick"/>
    </Triggers>
    <ContentTemplate>
        <asp:Timer ID="TimeSheetTimer" Interval="1000" runat="server" OnTick="TimeSheetTimer_Tick" ClientIDMode="Static"></asp:Timer>
    </ContentTemplate>
</asp:UpdatePanel>


Code Behind:
C#
protected void TimeSheetTimer_Tick(object sender, EventArgs e)
       {
           File.WriteAllText(@"C:\checkTimesheetcontrol.txt", "");
           File.AppendAllText(@"C:\checkTimesheetcontrol.txt", "Check :" + DateTime.Now.Second);
           return;
       }


I need it to be perform ealier once the control in loaded in page.How Can I do for it?

What I have tried:

I've not idea to fixz the problem.
Posted

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

  Print Answers RSS


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